<[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED]
>
> I need to listen to an event fire by Firefox when user exits this app
> (or when all windows are closed).  I need to do this using Javascript

I can help you only shutdown notification, this only works with Firefox and 
Thunderbird.
This doesn't work on Mozilla and NVU.

*** Here you add the observer called at firefox shutdown
       // see below
        var obs = ViewSourceWithCommon.getObserverService();
                obs.addObserver(this, "quit-application-requested", false);

*** This function is called at shutdown time
    observe : function(subject, topic, state) {
        if (topic == "quit-application-requested") { // sanity check
            this.clean();
        }
    }

ViewSourceWithCommon.getObserverService = function () {
    const CONTRACTID_OBSERVER = "@mozilla.org/observer-service;1";
    const nsObserverService = Components.interfaces.nsIObserverService;

    return 
Components.classes[CONTRACTID_OBSERVER].getService(nsObserverService);
}

You can see how it works inside my extension ViewSourceWith 0.0.7.1

https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&id=394

bye

davide




_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to