chrome extension code to get current active tab url and detect any url update in it as well

I want to write a chrome extension which can get the URL of active tab. I want it to always display the current website the person is viewing on his active tab of the current active window. I use the