on tab active send url background js chrome site:stackoverflow.com code example
Example: get url of page in background script
chrome.tabs.query({
active: true,
currentWindow: true
}, function(tabs) {
var tab = tabs[0];
var url = tab.url;
});