Pestaña de corriente de extensión de Chrome
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
// {active: true, currentWindow: true}: current tab of the active window
// tabs parameter is an array holding objects providing access to url
const activeTab = tabs[0];
const activeTabId = activeTab.id;
const activeTabURL = activeTab.url;
// do whatever you want with the above values
});
// the following should be added to manifest.json for chrome extension
"permissions": [
"tabs"
]
Wissam