I want to make my Google Chrome Extension disabled by default and then enable it based on the content flow , how could I achieve it ?
Here is the API to make the extension disabled , I need that by default . https://developer.chrome.com/extensions/browserAction#method-disable
In your background page (as configured in manifest.json
eg):
"background": {
"scripts": [
"js/background.js"
]
}
You can do the following to disable the extension each time a tab is opened::
chrome.tabs.onCreated.addListener(() => {
chrome.browserAction.disable();
});
Then later, based on flow call chrome.browserAction.enable();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.