搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Can I disable firefox automatic session restore

  • 30 个回答
  • 2 人有此问题
  • 7 次查看
  • 最后回复者为 leishman

more options

Hi, I would like to start firefox with a new session (one tab on my home page) I am using Firefox 74.0 on openSUSE Leap 42.3 - KDE Plasma 5.8.7. In the preferences I have "Restore previous session" unchecked. in about:config I have:

browser.sessionstore.resume_from_crash        false
browser.sessionstore.max_resumed_crashes  0

I don't have a user.js

I log out of KDE without closing firefox. At the next login all my tabs and windows are restored. I would like to start with a new session with the option of restoring the old session using the menu. I want to keep my history and the undo close tab/window functionality. Is there a way to do this ?

Hi, I would like to start firefox with a new session (one tab on my home page) I am using Firefox 74.0 on openSUSE Leap 42.3 - KDE Plasma 5.8.7. In the preferences I have "Restore previous session" unchecked. in about:config I have: browser.sessionstore.resume_from_crash false browser.sessionstore.max_resumed_crashes 0 I don't have a user.js I log out of KDE without closing firefox. At the next login all my tabs and windows are restored. I would like to start with a new session with the option of restoring the old session using the menu. I want to keep my history and the undo close tab/window functionality. Is there a way to do this ?

由leishman于修改

所有回复 (20)

more options

Sorry I mean automatic of course

more options

leishman said

Sorry I mean automatic of course

Hello leashman,

Absolutely no need to apologize for a typo !

May I ask why you don't want to close Firefox ? When you close Firefox (and have it set to remember history etc.), wouldn't that do what you want ?

more options

Of course that would (and does) work. But when I log out I have many open windows. Logging out closes them all automatically. I would hope that firefox closes cleanly. If it doesn't and thinks this is a crash the about:config settings should still mean there is no automatic restore.

Is there some additional config that will help me ?

more options

leishman said

when I log out I have many open windows. Logging out closes them all automatically.

I must be needing a break, cause all that I read here is : you do want to restore the previous session ......

I sure hope that someone with better working braincells will come to your rescue (so sorry ... )

more options

No I want the default behavior on startup to be a new session. The option to restore the old session (if I want it) is available in the menu.

more options

leishman said

No I want the default behavior on startup to be a new session. The option to restore the old session (if I want it) is available in the menu.

Now, this will probably be another dumb question : but why don't you just use the "Restore previous session" option, close Firefox, and at startup, when you want to start a "new session" just open a new window or tab ? You'll still have all your previous windows and/or tabs, and be able to start a "new session". And you can close any window/tab that you no longer need.

But I'll make myself scarce now - don't want to drive you nuts.

more options

'Couldn't let it go just yet and was thinking that maybe you could use this add-on :

https://addons.mozilla.org/en-US/firefox/addon/window-session-saver

Worth a try .....

Then you can just close Firefox, and at startup your homepage will open.

more options

Thanks for the suggestion. I installed the addon. Unfortunately it doesn't seem to make a difference. After a new login when I start firefox it reloads all the old tabs and windows.

Is this really a bug? If the restore is switched off in the preferences and the about config has "browser.sessionstore.resume_from_crash false" then there should never be an automatic session restore, right ?

more options

You know, I must be totally misconstruing your question, so I'm going to do what I should have done in the first place and let you wait for someone else to come to your rescue ......

more options

OK. Thanks anyway

more options

I will now forward this thread to a fellow contributor who just might come up with the perfect solution for you (fingers crossed .... ).

more options

leishman said

in about:config I have ...
browser.sessionstore.max_resumed_crashes 0

It seems you have Firefox set to not automatically restore the previous session after a crash, but instead to show you the screen indicating Firefox wasn't able to restore automatically and giving you the choice between restoring or starting a new session. Selecting to start a new session there may discard your session history, so this isn't what you want to do.

But you also have:

leishman said

browser.sessionstore.resume_from_crash false

Although I have never tested that setting, I assume it does what it says.

So why is your session getting restored? If you were running Windows 10, I would point to a feature where Firefox integrates with the OS to restore your session. The preference for that is described in the following article:

Firefox starts automatically when I restart Windows

However, I don't know whether Linux versions of Firefox have anything like that.

I log out of KDE without closing firefox. At the next login all my tabs and windows are restored.

Are you sure that logging out is actually terminating Firefox, and not leaving it running in the background somehow? I would be more convinced this is a session restore behavior if it occurred after you did a complete shutdown.

more options

Does Firefox create a sessionstore.jsonlz4 ?

If Firefox is forced to close in such a way that sessionstore.jsonlz4 doesn't get created then Firefox will fallback to files in the sessionstore-backups folder. Also keep in mind that you might corrupt your profile folder or lose other session data that was kept in memory and isn't written to the profile folder. If you close Firefox properly via "File -> Quit" then this should work.

I'm curious why you logout of KDE, but do not want to close Firefox properly.

Do you intend to login as another user or are you closing down the computer (i.e. not hibernate or suspend to disk)?

more options

leishman said

Thanks for the suggestion. I installed the addon. Unfortunately it doesn't seem to make a difference. After a new login when I start firefox it reloads all the old tabs and windows.

I totally misconstrued your reply to my question why you don't close firefox : I thought you kept firefox open so you wouldn't lose your open windows and tabs, and yet you wanted to start a new session .....

(edit : typo)

由McCoy于修改

more options
more options

Thanks to all for your help.

I made the settings

 browser.sessionstore.max_resumed_crashes 0
 browser.sessionstore.resume_from_crash false

in order to try and stop the automatic session restore. The resume_from_crash setting appears to have no effect. This may be a bug.

KDE does have a session management system but I am not using it and start firefox manually.

When I log out it is almost always to shutdown the computer. Firefox is no longer running after a logout. KDE terminates it - not sure how.

As I mentioned above - if I quit firefox by closing it manually everything is fine - When I restart firefox it will start with a new session. Why don't I do this ? When I logout (usually to shutdown) I have lots of windows open. I don't want to spend time going around my desktops closing everything (call me lazy). The logout should be a normal event for firefox and not be interpreted as a crash.

I don't know how kde stops processes in the logout process. If I kill firefox manually (killall firefox-bin firefox) then firefox is terminated. No sessionstore.jsonlz4 file is created in my profile. However If I restart firefox it does NOT restore the session - it starts with a new session - exactly what I want !!

more options

leishman said

When I logout (usually to shutdown) I have lots of windows open. I don't want to spend time going around my desktops closing everything (call me lazy).

See the last post in this thread :

https://support.mozilla.org/en-US/questions/1138603

more options

Okay, this much is clear:

(1) Crash recovery is not happening in your Firefox, as evidenced by what happens when you intentionally crash it.

(2) Your Firefox does not automatically restore your previous session, as evidenced by what happens when you use Quit.

That implies your OS is doing something special to restore your open windows, but I'm not aware of how your shell or distribution work, so I don't know whether that is what's happening. But what else could it be?

more options

Hi thanks for your response and taking time to think about my problem.

 (1) Crash recovery is not happening

I tried switching browser.sessionstore.max_resumed_crashes and browser.sessionstore.resume_from_crash back to default. When I then crash firefox (killall firefox firefox-bin) and restart the session is restored. with browser.sessionstore.resume_from_crash false the session is not restored.

So I agree the normal crash recovery is not happening when I restart firefox after a logout and subsequent login.

 (2) Your Firefox does not automatically restore your previous session

Certainly when I quit normally (eg. quit from menu) and restart, firefox starts with a new session and does not restore the previous session.

 That implies your OS is doing something special ...

I don't really believe that. There is some software around to try to integrate firefox with kde but this is done using additional addons - I have none of these installed.

It seems that when I logout of kde while firefox is running it leaves the profile in a state where firefox on restart doesn't do a crash recovery but still restores the previous session.

Are there any other config possibilities I can try ?

more options

It sounds as though Firefox is getting a signal similar to the one used for updates where

browser.sessionstore.resume_session_once

is set to true. This could be done in

  • prefs.js
  • user.js
  • Autoconfig file

But as far as I know, Firefox would never be doing that itself when being shut down by the OS.

Good luck finding that or whatever else is happening.

  1. 1
  2. 2