javascript - WebExtension browserAction.onClicked does not trigger -
i trying make content script work, contains :
chrome.browseraction.onclicked.addlistener((tab) => { chrome.browseraction.disable(tab.id); console.log(tab.url); });
i have added these lines in manifest :
"permissions": [ "activetab", "tabs" ], "browser_action": { "default_icon": "icons/premod-32.png", "default_title": "premod" }, "content_scripts": [ { "matches": ["*"], "js": ["content_scripts/jquery.js", "content_scripts/premod.js"] } ]
i can see browser action, when click on it, not disabled , can not see log in console.
solved : code had in background file.
Comments
Post a Comment