Firefox-Addon: Restart and save all current tabs and windows

Posted by nokturnal on Stack Overflow See other posts from Stack Overflow or by nokturnal
Published on 2010-04-21T14:30:43Z Indexed on 2010/04/21 14:33 UTC
Read the original article Hit count: 631

Hello guys / gals,

First off, this is my first attempt at writing an add-on. That being said, I am attempting to write an add-on that makes some configuration changes and needs to restart Firefox in order to have the changes take effect. I am currently restarting Firefox using the following code:

        var boot = Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup);  
    boot.quit(Components.interfaces.nsIAppStartup.eForceQuit|Components.interfaces.nsIAppStartup.eRestart);  

The problem is, it restarts and opens the browser window(s) to whatever the users homepage is currently set to. I want it to re-open all windows / tabs that were previously open before the restart (similar to what happens when you install a new add-on).

Anyone ever messed with this type of functionality before?

© Stack Overflow or respective owner

Related posts about firefox-addon

Related posts about firefox-extension