[Project_owners] Exit Fiefox

eric.jung at yahoo.com eric.jung at yahoo.com
Sat Sep 15 07:24:10 PDT 2007


Look here:


----- Original Message ----
From: joe ertaba <belaviyo at gmail.com>
To: Mozdev Project Owners List <project_owners at mozdev.org>
Sent: Saturday, September 15, 2007 4:59:55 AM
Subject: [Project_owners] Exit Fiefox


in my extension i like to exit Firefox after saving tabs url, how can exit Firefox? , i can exit from Firefox by this code

    var wm = Components.classes["@
    var browserEnumerator = wm.getEnumerator("navigator:browser");
    var found = false;
    while (!found && 
browserEnumerator.hasMoreElements()) {
            var curBrowser = browserEnumerator.getNext();
            var browserInstance = curBrowser.getBrowser();

            var numTabs = browserInstance.tabContainer.childNodes.length
            for(var index=0; index<numTabs; index++) {
                  var currentTab = browserInstance.getBrowserAtIndex(index);
                  //Save URl :       currentTab.currentURI.spec


this code works good when there isn't any other windows, but when some other window is open (like download manager , option window,...) Firefox doest exit !

it is possible to close download manager, option window by enumerating on them and do above code again but what about unknown windows

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070915/56c8297d/attachment.html 

More information about the Project_owners mailing list