Chrome extension: disable browser action

Can I disable the action of a browser button? or cancel the popup when the condition is true?

Bean

+4
source share
2 answers

You can disable it with the following code:

chrome.browserAction.enable (integer tabId);

For more information, see Chrome Apis:

http://developer.chrome.com/extensions/browserAction.html#method-disable

+3
source

You can remove the popup using:

chrome.browserAction.setPopup({popup: ""}); 

and switch icon to disable:

 chrome.browserAction.setIcon({path: "icon-disabled.png"}); 

To enable, you will need to run these methods again with the appropriate parameters.

+4
source

Source: https://habr.com/ru/post/1379873/


All Articles