4

I usually close Firefox with the command:

killall firefox

Many websites and tabs accumulate over time. At the end of the day, many remain unprocessed and should not be processed the next day either.

So I want to close Firefox and start it again as empty as possible, but Firefox restores all tabs.

How could I prevent this?

Update

Using firefox 99.0

kanehekili
  • 6,402
SL5net
  • 628
  • 9
  • 22
  • 12
    This is a "I'm not using it how I'm supposed to and it's not working how it's supposed to" kind of question. – gronostaj May 02 '22 at 07:49
  • 1
    You could do it from the GUI by opening the profile manager (use switch -profilemanager IIRC), then create a new profile and launch. – pbhj May 02 '22 at 14:35
  • This feels like an XY(?) problem. Why would you use killall firefox when Alt+F4 exists, or Ctrl+Q, or Ctrl+Shift+W, or clicking the close button, all of which gracefully close Firefox faster, and without causing your problem. – Alex but school May 02 '22 at 15:18

3 Answers3

8

Killall firefox will force firefox to restore its tabs, no matter what your settings are. Most convenient way is to open Settings->General and untick "Open previous windows and tabs":

If you want to prevent event the restore on a crash (which you are doing by "kill") you could setup in about:config

browser.sessionstore.resume_session_once True

In case it is not there, you could add it by entering it into about:config, select "boolean" ,then pressing the "+" button

kanehekili
  • 6,402
  • 1
    this entry about:config> browser.sessionstore.resume_session_once True is not in this new firefox verson (99.0). i tried browser.startup.couldRestoreSession.count = 0 but it automatically set it to 1. and all pages are restored later in my test – SL5net May 02 '22 at 09:45
  • 1
    That is an important info. I added it into your question – kanehekili May 02 '22 at 10:00
  • in FF v105.0 i set browser.sessionstore.restore_on_demand false. now FF asks me to restore next before restore – SL5net Oct 12 '22 at 15:46
6

The tab recovery data is stored in the sessionstore-backups directory under your profile directory (example ~/.mozilla/firefox/..XYZ..x.default-release/sessionstore-backups/ ) . If you delete (or move to a different location in case you change your mind or something breaks) all the files in this directory there will be nothing to restore. You can for example make a wrapper script to clean-invoke firefox that wipes this directory first.

SL5net
  • 628
  • 9
  • 22
0

Go to Settings > General > Startup and then uncheck the option "Open previous windows and tabs"

  • yes there is this option. but it is already unchecked. hmm https://i.imgur.com/Cm7AxlM.png – SL5net May 01 '22 at 20:50
  • 5
    This option only applies to a normal start. But the OP is deliberately crashing Firefox instead of shutting it down, and Firefox will then try to recover from the crash into the exact same state right before it crashed, no matter what the this option is set to. In fact, before this setting existed, deliberately crashing Firefox was the only way to get it to restore tabs, and thus this trick was used by many users. – Jörg W Mittag May 02 '22 at 06:52