Firefox add-on sdk uninstall hook

I save some user data in simple-storage . When the user disables the add-in, I want to delete this user data. Is there some kind of event or something similar?

+6
source share
2 answers

This will work in every file:

 require("sdk/system/unload").when(function(reason) { if (reason == "uninstall") { // do uninstall stuff.. } }); 
+5
source

Try the following:

 exports.onUnload = function(reason) { //do stuff for unload here } 
+2
source

Source: https://habr.com/ru/post/975529/


All Articles