Gary Sieling

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);
});
Exit mobile version