[Project_owners] Extension enable/disable events

Rod Whiteley rod.whiteley at gmail.com
Tue Sep 13 12:10:20 EDT 2005


The extension is actually enabled or disabled during startup, when the 
extension is not loaded.

I suspect it might be possible for the extension to install a component 
to receive the notifications during startup, but I have not tried it 
that way.

In my extension I overlay code in the Extension Manager window.  This 
detects whether the user has disabled my extension there and sets a 
flag.  Then, when the user closes the application I use the main 
window's unload to check the flag and clean up if necessary.

When the user re-enables my extension, it is currently disabled so there 
is nothing I can do.  It would be possible for the cleanup to set a pref 
for the extension to check every time it starts up.  But this could lead
to problems if the user disables then uninstalls without manually 
clearing the pref, the reinstalls.

http://www.mozdev.org/source/browse/calendarhelp/src/calfolder/content/calfolder/extensions.js?rev=1.1

-- 
Rod Whiteley


More information about the Project_owners mailing list