How do I use Firefox' "sessionstore" files to restore my crashed session?

My Windows XP system crashed. Usually about:sessionrestore shows me my previous session. But this time, after I rebooted, the page appeared blank.

I was able to find my sessionsstore files in my profile folder. They have names like sessionstore-1.js through sessionstore-8.js. There is also a sessionstore.bak, which was probably created when the system crashed. I don't trust the sessionstore.bak: it's really small in size.

Can I use sessionstore-8.js instead to get back my old sessions?

Also, how exactly do I go about this? Should I quit Firefox before making any changes under the profile directory?


Solution 1:

You can use the utility at http://firefox-session-restore.herokuapp.com/ to restore your tabs. Just paste in the contents of sessionstore.bak.

Solution 2:

Open the most recent file (probably sessionstore.js) in an advanced text editor supporting regular expression search and replace (for example, TextPad and Notepad++).

Replace all

"entries":\[{"url":"([^"]*)"

with

\n\1\n

And the URLs of the last opened tabs will appear on every other line.

(Note on TextPad: you need to enable POSIX syntax in PreferencesEditor.)