15

In which location and file does Firefox save the last windows I had opened (when Firefox crashed)?

I have a complete "hot dump" copy of a file system and need to restore the state Firefox was when the system crashed, but I cannot restore the full backup itself. I can only extract the files of Firefox, but I do not know in which files I have to search for the URLs that were last opened when the snapshot of the whole file system was done.

Hennes
  • 65,804
  • 7
  • 115
  • 169
jens
  • 161

2 Answers2

18

It's in sessionstore.js in your profile directory. It can be moved to a different profile without problem.

(This might also show sessionstore.bak, which is a backup of the previous version of that file.)

Arjan
  • 31,511
3

Arjan's answer is still mostly correct, but Firefox now stores current windows and tabs in sessionstore.jsonlz4. This file is in a non-standard compressed form; see this answer for details and ways to decompress it (I had luck using this tool).

Additionally, Firefox only creates this file when exiting, so it will not exist on disk while the relevant profile is in use by a running instance of Firefox. That said, backups of sessionstore.jsonlz4 are kept in .../<profile>/sessionstore-backups/. In my case there are six backups in here of varying names, so I would fall back to the modification time of these files to identify the most recent.

Finally, none of this applies to Android. The "sessionstore" files do not exist, and Firefox instead keeps a tab list in /data/data/org.mozilla.firefox/files/mozilla_components_session_storage_gecko.json. Notably, this is not inside the profile directory. This file is not compressed like the .jsonlz4 files. As far as I can tell, there are no automatic backups kept of this file.

swilton
  • 41