I need help to create a callback when my chrome extension in disabled. I have already referred this link that says about adding a listener onDisable. But this doesnt work for own. When my extension is disabled, it does nothing. There is an answer in this link that says we can not do this, But I am still hoping that I can find something new on this topic. Please help me in this.
Asked
Active
Viewed 483 times
1 Answers
3
You are correct that management
API cannot catch the extension itself being disabled or uninstalled. This is by design - you don't want extensions to be able to stop you from removing them.
There is no event you can process when either of those happen.
There is an exception in that your content scripts continue to run in an "orphaned" state and can detect that the parent extension is not there anymore by poking at Chrome API (and possibly onDisconnect
event on a Port object), but at that point the content script can't do much.
Curiously, there is no event that will fire on enabling either. This can cause problems when an update happened while an extension was disabled and relies on runtime.onInstalled
event to perform upgrades.