Hello Eric.

You have to define an observer to it - the hash id of the observer is
"em-action-requested"
you should add an observer with this id
and you have those consts that responsible to the different
notifications to observer for:
"em-action-requested"
"item-installed"
"item-upgraded"
"item-uninstalled"
"item-enabled"
"item-disabled"
"item-cancel-action"

in the observer definition you should ask on the uninstall method:

observe: function(aSubject, aTopic, aData)
{
try
{
if(aData == "item-uninstalled")
{
var objExtensionItem =
aSubject.QueryInterface(Components.interfaces.nsIU pdateItem);

if(objExtensionItem.id == [YOUR_GUID_EXTENSION])
{
//Do whatever need to do here.
}
}

}
catch(err){}
}

I should mention that this is work only from Firefox 1.5+ (the new api).


On 8/1/06, Eric H. Jung wrote:
> Hi,
>
> I want to delete a file when my extension is uninstalled (the file isn't in the extension's directory). How can my extension be notified and execute code when it is being uninstalled?
>
> Thanks,
> Eric
>
>
> _______________________________________________
> dev-extensions mailing list
> dev-extensions@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>