I had a set of Firefox windows and tabs open on my Windows 7 laptop. I was in the middle of one thing when I started an unrelated effort to rebuilt a secondary disk to allow the laptop to boot MacOs and Ubuntu. I knew I wanted to preserve the session of Firefox windows for my other effort so I was using Chrome to keep the two projects separate. Somewhere in there, I installed new software which automatically opened Firefox and then I rebooted effectively killing off my ability to use Restore Previous Session from the Firefox menu. But I wasn’t ready to be done with those tabs! So I dug around in the Firefox folders and figured out how to restore the session I wanted. Here’s what to do if it happens to you in the latest version of Firefox.
I’m running Firefox 58 Developer Edition but I think it would be the same for most versions.
First, exit any open sessions of Firefox.
Open a Windows Explorer folder to the following location where user is replaced with your username and profilename is replaced with whatever random characters are in your profile name: C:\Users\user\AppData\Roaming\Mozilla\Firefox\Profiles\profilename.dev-edition-default\sessionstore-backups
In this folder is a list of the backups for your prior sessions including, hopefully, the one you want to retrieve. For me, I used Textpad to do a Find In Files and search all of the files in this folder that contained a keyword for something that I knew was in one of the Firefox sessions. And the date stamp in the filename matched.
Now with that file identified, copy it to one folder level up: C:\Users\user\AppData\Roaming\Mozilla\Firefox\Profiles\profilename.dev-edition-default
Then delete the file in that folder named sessionstore.jsonlz4 and rename the file you just copied there to sessionstore.jsonlz4.
Open Firefox and hit the “alt” key to show the menubar (or whatever you need to do to see the menubar visible on your installation of Firefox. Then select the History -> Restore Previous Session menu item and you should have your session restored.