Georgi Naumov
Georgi Naumov

Reputation: 4201

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?

Upvotes: 6

Views: 372

Answers (2)

erikvold
erikvold

Reputation: 16508

This will work in every file:

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

Upvotes: 5

Noitidart
Noitidart

Reputation: 37228

Try this:

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

Upvotes: 2

Related Questions