0

Normally, when you close Firefox with a bunch of opened tabs, they get stored in a file called previous.jsonlz4 and are restored the next you open Firefox.

However, over the last couple of months, I have on several occasions opened Firefox only to find a single blank page, nothing in "history->recently closed (tabs|windows)" and only a freshly created recovery.jsonlz4 in my profile folder.

While I cannot be certain, this does seem to coincide with Firefox updates.

So my question is:
Other than disabling automatic updates in my packet manager (do not want) or creating some kind of hook to create a backup of the sessionstore every time I close Firefox (unrealistic) - is there any way to prevent this from happening in the future?

1

1 Answer 1

0

I use Firefox Dev Edition on Windows 10, but I've never seen anything like it. Maybe it has to do with the way the Firefox process is terminated (not too gracefully). It must have the time to write to disk whatever data is has to to restore your previous session. Can the folder where this file is stored be locked while Firefox is running, and unlock takes too much time, hence the mishaps you describe?

In Windows, you can write in the Firefox folder in Programs, but your user folder in AppData\Mozilla\Firefox\Profile\Default-whatever-version-you-have\ is locked.

4
  • I'm using Linux where there is no such thing as "locking a folder". However, this cannot be the issue: While running, Firefox constantly updates the recovery.jsonlz4 (and recovery.baklz4) files, so even if it couldn't write the most recent changes, the profile should never come up empty. It used to be that Firefox kept a copy of the last couple of sessions along with the last one but apparently they stopped doing that :/
    – Entropy0
    Commented Mar 23, 2020 at 19:10
  • The folder is owned by the application while running, that's what I meant. In Windows, you can take ownership of a folder on the fly, usually with disastrous consequences if you don't know what you're doing. In Unix too, but it requires a chmod with elevated rights. When the application isn't running, though, any folder except /bin is fair game for read-write, except system folders and files. I'm not sure Firefox constantly updates this file, anyway. I think it only writes into it when you close the program, that would reduce I/O when not necessary. Not sure, though.
    – user1019780
    Commented Mar 23, 2020 at 19:38
  • It gets updated according to the interval stored in browser.sessionstore.interval (or […].idle if you're idle).
    – Entropy0
    Commented Mar 23, 2020 at 19:49
  • Oh, that's one of the things I disable first when installing Firefox. This would explain that. If you use disk cache (and even if you don't), it makes for a lot of useless I/O: if Firefox crashes, since most of the data resides in the RAM anyway, your session will likely not be restored, of Firefox will crash trying to do it (been there, done that), so I just set a very high number, usually off the top of my head. By default, it's set at 15 secondds, I think. So yes, you're right, your issue doesn't come from that. Been to about:config and searched "sessionstore" to check for discrepancies?
    – user1019780
    Commented Mar 23, 2020 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .