chrome.tabs.query({
active: true,
lastFocusedWindow: true
}, function (tabs) {
// and use that tab to fill in out title and url
var tab = tabs[0];
console.log(tab.url);
alert(tab.url);
});
This code shows me the URL in the alert()
window, but I need to store this URL in a variable so I can store it or display it as I need.