This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox restores tabs each time I restore the browser, setting is not turned on

  • 2 replies
  • 0 have this problem
  • 1 view
  • Last reply by cor-el

more options

When I open Firefox after starting my computer, all of my tabs from the previous session are automatically restored, and they take several minutes to load. I don't have the "Open previous windows and tabs" setting enabled. Is there a way to stop Firefox from loading these tabs each time I open the browser?

I'm using Firefox 103 on KDE neon 5.25.

When I open Firefox after starting my computer, all of my tabs from the previous session are automatically restored, and they take several minutes to load. I don't have the "Open previous windows and tabs" setting enabled. Is there a way to stop Firefox from loading these tabs each time I open the browser? I'm using Firefox 103 on KDE neon 5.25.

Chosen solution

Do you Quit Firefox (using the menu) at least 30 seconds before you shut down the computer? Firefox needs time for its file maintenance and recording that your session terminated normally. If Firefox doesn't find the entry indicating that it shut down normally, it will attempt an automatic crash recovery at the next startup.

The Linux version of Firefox also has an integration with the OS so if you shut down the OS without first quitting Firefox, when Firefox is instructed by the OS that it needs to close for a system shutdown, it sets a flag to restore your session at the next startup.

Read this answer in context 👍 1

All Replies (2)

more options

Chosen Solution

Do you Quit Firefox (using the menu) at least 30 seconds before you shut down the computer? Firefox needs time for its file maintenance and recording that your session terminated normally. If Firefox doesn't find the entry indicating that it shut down normally, it will attempt an automatic crash recovery at the next startup.

The Linux version of Firefox also has an integration with the OS so if you shut down the OS without first quitting Firefox, when Firefox is instructed by the OS that it needs to close for a system shutdown, it sets a flag to restore your session at the next startup.

more options

See also these prefs on about:config that Firefox automatically sets.

  • browser.sessionstore.resume_session_once
  • browser.sessionstore.resuming_after_os_restart

To make this work properly you would have to use an autoconfig.cfg file to test whether we have a restart due to OS restart and if true, set both resuming_after_os_restart and resume_session_once prefs to false. That way you can still have a valid restart to apply an update that keeps your session.

onQuitApplication:


You can use the autoconfig.cfg file in the Firefox installation folder to initialize (set/lock) preferences and run privileged JavaScript code.

To use Autoconfig, place two files into the Firefox installation directory.

  • on Windows and Linux, they go into the same directory where Firefox is installed
  • on macOS, they go into the Contents/Resources directory of the Firefox.app

The autoconfig.js file that specifies to use autoconfig.cfg is placed into the "defaults/pref" directory where the channel-prefs.js file is located. The autoconfig.cfg file is placed at the top level of the Firefox directory.

  • autoconfig.cfg and autoconfig.js need to start with a comment line (//)
  • autoconfig.js needs to use Unix line endings (LF instead of CR/LF)

See also:


The content of autoconfig.js:

//
pref("general.config.filename", "autoconfig.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false);

The content of autoconfig.cfg:

// autoconfig.cfg need to start with a comment line
// autoconfig.js => pref("general.config.sandbox_enabled", false);
var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;

if (Services.appinfo.restartedByOS) {
 Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", false);
 Services.prefs.setBoolPref("browser.sessionstore.resuming_after_os_restart", false);
}

Modified by cor-el