He estado luchando durante mucho tiempo con Chrome Extensions. ¿Cómo obtengo la URL de la pestaña de background.js (mi trabajador de servicio)?
Parece una cosa muy fácil de hacer pero........
// manifest.json { "name": "Getting Started Example", "description": "Build an Extension!", "version": "1.0", "manifest_version": 3, "background": { "service_worker": "background.js" }, "permissions": ["storage", "activeTab", "scripting"], "action": { "default_popup": "popup.html" } } // background.js chrome.tabs.onActivated.addListener(activeInfo => { chrome.tabs.get(activeInfo.tabId, (tab) => { // tab.url is undefined, it should not. }); });no funciona por qué ?