How to find the URL of the current tab in a Chrome extension

It’s a little hard to find – getCurrent() returns the current hidden page for the extension.

chrome.tabs.getSelected(null, function(tab){
   var baseUrl = tab.url;
   console.log(baseUrl);
});

Leave a Reply

Your email address will not be published. Required fields are marked *