Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox add-on sdk uninstall hook

I keep some user data in simple-storage. When the user uninstalls the add-on I want to remove this user data. Is there some event or something similar?

like image 823
Georgi Naumov Avatar asked Sep 19 '14 12:09

Georgi Naumov


People also ask

Where are my Firefox add ons?

Click the menu button. and choose Add-ons and Themes. The Add-ons Manager tab will open. Select the panel for the type of add-on you wish to view or manage, such as the Extensions or Themes panel.


2 Answers

This will work in every file:

require("sdk/system/unload").when(function(reason) {
  if (reason == "uninstall") {
    // do uninstall stuff..
  }
});
like image 169
erikvold Avatar answered Sep 27 '22 21:09

erikvold


Try this:

exports.onUnload = function(reason) {
   //do stuff for unload here
}
like image 30
Noitidart Avatar answered Sep 27 '22 22:09

Noitidart