I am creating an extension for Chrome. I want to show an alert() with the page URL whenever the user moves from one tab to another, or when the user enters a new URL in a tab.
This is not working:
chrome.tabs.onUpdated.addListener(function(integer tabId, object changeInfo, Tab tab) {
alert(changeInfo.url);
});
chrome.tabs.onActivated.addListener(function(object activeInfo) {
// also please post how to fetch tab url using activeInfo.tabid
});