Is there a way to run a callback after extension is disabled/enabled from chrome browser.
Chrome management API()'s
chrome.management.onEnabled.addListener(function(ExtensionInfo info) {})
chrome.management.onDisabled.addListener(function(ExtensionInfo info) {})
notifies changes of enable and disable of extensions.
Ensure you have
"permissions": [
"management"
],
in your manifest.json
chrome.management.onDisabled.addListener(function(ExtensionInfo) {
console.log(JSON.stringify(ExtensionInfo));
});
P.S : An extension on its own can't monitor when it gets disabled. You'd need a second extension to monitor this. From extension's and user's perspectives, disabling extension has exactly the same effect as closing a browser.
For more information refer documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With