If an add-on changes a preference outside its own preference branch, then it should revert them back to their previous state (not necessarily the default state) on uninstalling the add-on.
I imagine, the current preferences have to be saved and then at uninstall used to revert back.
Running AddonManager.addAddonListener()
seems to be an option (but running a process continuously!). Is there any other option?
In a bootstrapped addon, there is a function uninstall() {}
, but how is it done in an overlay add-on?
Other useful topics on the subject (but not fully answering this question):
Firefox Addon: how to remove preferences when addon is being uninstalled?
Set preferences in the user branch and unset them on uninstall
Update By running a process continuously I meant, running a listener/process for example for an event that may happen once a year. I have already thought of another way which could be more efficient but since that was a hypothetical situation, I don't have the anything to test it on.
Using
AddonManager.addAddonListener()
is the correct path to take when using an old school overlay add-on.I'm not sure what you mean when you say
but running a process continuously!
the listener is just added to an array of listeners, and there is no new process running.