views:

73

answers:

2

Hi there,

I'm working on a firefox addon and one thing i'm unsure on is how to remove user preferences related to my addon when the user uninstalls it. The preferences get set, and if the user uninstalls and reinstalls the preferences are all still there. Some settings also relate to a first time install, so that breaks if the user has installed it previously.

Is there something I can setup that will be called when a user uninstalls, or a process to remove preferences on uninstall?

Thanks!

+1  A: 

There is no way to do this. Addons are simply deleted off by the browser and not told that they will be uninstalled. You could provide a 'Restore Factory Settings' button somewhere on your add on GUI.

Ali
fair enough. I had a feeling that might be the case since if it let the addon know it was being deleted that could leave the door open for it to do something malicious. Thanks
jpcamara
This isn't true - it is in fact possible to do this, although it isn't always 100% reliable.
sdwilsh
+1  A: 

You'll want to take a look at this page which shows you how to register an observer to get the right events. Note that it's not always 100% reliable, but there should be a way to do this in Firefox 3.7 (Gecko 1.9.3).

sdwilsh
thanks for the clarification.
jpcamara