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

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -