Suppose a user disables my extension and then allows it.
How to run a function when you turn on the extension?
I tried to do something similar to running the on-extension-install function using localStorage, but it does not work for this case with the extension-reenabled, because localStorage is not cleared for the background page when it is turned off.
if (!localStorage["isInstalled"]) {
onInstall();
localStorage["isInstalled"] = 1;
}
source
share