Este site irá ter funcionalidade limitada enquanto fazemos manutenção para melhorar a sua experiência. Se um artigo não resolve o seu problema e quiser colocar uma questão, temos a nossa comunidade de apoio à espera de o ajudar em @FirefoxSupport no Twitter, /r/firefox no Reddit.

Pesquisar no apoio

Evite burlas no apoio. Nunca iremos solicitar que telefone ou envie uma mensagem de texto para um número de telefone ou que partilhe informações pessoais. Por favor, reporte atividades suspeitas utilizando a opção "Reportar abuso".

Saber mais

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

  • 2 respostas
  • 0 têm este problema
  • 1 visualização
  • Última resposta por 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.

Solução escolhida

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.

Ler esta resposta no contexto 👍 1

Todas as respostas (2)

more options

Solução escolhida

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);
}

Modificado por cor-el a