Where does Firefox save currently open tabs on disk
Asked Answered
T

2

6

For example Chrome saves here: ~Library/Application Support/Google/Chrome/Default/Current Tabs and Safari here ~/Library/Safari/LastSession.plist. What about Firefox? I found this folder ~/Library/Application Support/Firefox/Profiles/sewzwkcf.default but I cannot spot the right file.

Troostite answered 11/3, 2015 at 19:33 Comment(1)
This question belongs on SuperUser.com, and was been answered there in 2010 - Where does Firefox store the opened windows/tabs/URLs for session restore after a crash?.Loydloydie
C
6

Since version 33, Firefox saves the open session in /sessionstore-backups/recovery.js, inside your Profile Folder.

Yoric says in this blog post:

• sessionstore-backups/recovery.js
contains the state of Firefox ≤ 15 seconds before the latest shutdown or crash...
...
All these files use the JSON format.

You can see all your open tabs, windows and session info in just a single file, being updated every few seconds.

Construe answered 13/3, 2015 at 19:23 Comment(0)
P
0

2023-08: The 8 yrs old answer is basically still valid. *.js (JSON) and *.bak files are now compressed and using *.jsonlz4 and .baklz4 extensions. This change happened sometime between 2017-09 and 2019-07.

There is a FF bug (described below), which someone searching for this Question probably just encountered. You can still fully recover manually.

Various Open Tabs State files

To sum what the blog article mentioned in edandaniel answer is saying,
Mozilla does this every ...

  • 15 sec: sessionstore-backups/recovery.jsonlz4 -> sessionstore-backups/recovery.baklz4,
    new sessionstore-backups/recovery.jsonlz4

  • Mozilla exit: new sessionstore.jsonlz4

  • Mozilla start: sessionstore.jsonlz4 -> sessionstore-backups/previous.jsonlz4

  • Mozilla start after upgrade: sessionstore.jsonlz4 -> sessionstore-backups/upgrade.jsonlz4-20230805021307

To recover

You can use apt install lz4 lz4json to unzip and inspect each file, but usually when the file is lost, it's re-created and is about 900 bytes big.
Fast fix would be to find bigger file, with most recent change date, copy it aside, exit Mozilla, copy/rename the copied file to sessionstore.jsonlz4, start Mozilla.

Current Mozilla bug

The bug currently present in Mozilla will cause a loss of opened tabs state, but the previous state can be recovered manually.
This happens when Mozilla is upgraded, but not restarted, then later exited properly, then started and without any change to tabs crashed.
sessionstore.jsonlz4 is not present while Mozilla is running, sessionstore-backups/recovery.*lz4 are not created without a change to tabs (I suppose), and sessionstore-backups/previous.jsonlz4 is present and OK, with identical content as sessionstore-backups/upgrade.jsonlz4-20230805021307, but is not used to recover lost tabs state. On sequential Mozilla start it is overwritten with the new, empty one.
But there still is sessionstore-backups/upgrade.jsonlz4-20230805021307 (20230805021307 part is an example), which can be used to recover, as described above.

Photostat answered 9/8, 2023 at 14:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.