For the most part, I'm very happy with Firefox as my primary browser. However, as someone who ends up with multiple windows open regularly, I occasionally find myself trying to close the browser without closing each window separately. Normally this is because some program is updating and complaining about Firefox being open.
The safe way to do this (on Windows) is to launch Task Manager and force quit, but every now and then I forget and right-click the open program in the toolbar, then close it from there. The issue with that approach is that Firefox seems to lose whichever window you trigger the "close all" feature on from the session state. All tabs, all data, lost immediately.
So far, when I've done this, the window lost has been one with a couple of tabs open and I've just shrugged it off. Sometimes I can even find them in the History panel if I'm lucky enough. Today, I did this with my main window, which has (well) over a hundred tabs and a bunch of specific pinned tabs all set up in a way I particularly want. Some of these tabs have been open for years and recovering it from History would be simply impossible. There was also no way to restore this window from the Firefox menu. I'll admit to getting a little panicked 😬
Luckily, it turns out there is a final, failsafe option you can use: cloning an old session state file from your profile! It's not perfect, but it restored the majority of my tabs and windows, which is better than nothing. So, for the next time I forget and have a minor heart attack, here are the steps I took:
- First, type in
about:supportto the Firefox address bar. This opens up a page where you can find your Profile Folder, as well as a button you can press to navigate to it directly in Explorer/Finder (it's in the first section, titled "Application Basics", about halfway down);
- Locate the
sessionstore-backupsfolder and make a copy (i.e. to your desktop);
- Shut down Firefox (note: use the Task Manager this time 😅);
- Once Firefox is closed, delete the session store files from within the profile folder;
- Then, in your cloned folder, find the largest/oldest file. Copy this back into the profile folder – not the
sessionstore-backupsfolder (that should have been deleted), but the root profile folder;
- Rename this cloned file to
sessionstore.jsonlz4; if a file of that name already exists, delete it;
- Start Firefox back up, and the older session should be restored, hopefully containing any lost windows/tabs.
This is still a lossy process, as the older session store may predate some tab changes or other actions you've taken, but if you're like me and have lost tabs going back years then at least you know these will have been safely retrieved.
And let's not talk about the underlying issue of tab hoarding, okay 😉