Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Can't restore tabs after shutting multiple windows (no crash). Any chance I find the "good one"?

more options

I opened 5-6 windows and closed them in the wrong order apparently, as I know that I must leave for the end the one I want to start my next session with (I've chosen "show my windows and tabs from last session"). In the next session I clicked on "recently closed windows", but the one I wanted didn't show up. Is there any chance I can find it?

I opened 5-6 windows and closed them in the wrong order apparently, as I know that I must leave for the end the one I want to start my next session with (I've chosen "show my windows and tabs from last session"). In the next session I clicked on "recently closed windows", but the one I wanted didn't show up. Is there any chance I can find it?

All Replies (8)

more options

Hi Andonis, unfortunately, Firefox only remembers three closed windows by default (you can increase the number going forward, but it won't help with the lost ones).

How long were those windows open? The reason I ask is that every time Firefox updates, which can be every few weeks, it takes a snapshot of your open windows and tabs. You could look at one of those recent snapshots to see what was in the windows as of that time.

Let's back up some files immediately to preserve options...

From inside Firefox, open your current Firefox settings (AKA Firefox profile) folder using either

  • "3-bar" menu button > "?" button > Troubleshooting Information
  • (menu bar) Help > Troubleshooting Information
  • type or paste about:support in the address bar and press Enter

In the first table on the page, click the "Show Folder" button to launch the folder in a new Windows Explorer window.

Scroll down and double-click into the sessionstore-backups folder. Save all files here to a safe location, such as your Documents folder. If not too much time has passed, we may be able to use them to recover your lost tabs.

What files did you find?

The kinds of files you may find among your sessionstore files are:

  • recovery.js: the windows and tabs in your currently live Firefox session (or, if Firefox crashed at the last shutdown and is still closed, your last session)
  • recovery.bak: a backup copy of recovery.js
  • previous.js: the windows and tabs in your last Firefox session
  • upgrade.js-build_id: the windows and tabs in the Firefox session that was live at the time of your last update

Could you take a look at what you have and the date/time of the various files to see whether you think any of them would have the missing windows/tabs?

Note: By default, Windows hides the .js extension. To ensure that you are looking at the files I mentioned, you may want to turn off that feature. This article has the steps: http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions

more options

Two notes for future reference:

(1) If you use the Exit command from the menu, all the windows open at that moment can be restored as open windows at the next startup and don't count toward the three closed windows. This is available in two places:

  • "3-bar" menu button > "power" button
  • (menu bar) File > Exit

(2) You can increase the number of closed windows, and the number of closed tabs per window, that Firefox remembers. Each increase does cause a little more disk activity, so if you have a slow hard drive, bear that in mind.

(A) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful.

(B) In the search box above the list, type or paste sess and pause while the list is filtered

To remember more closed windows:

(C) Double-click the browser.sessionstore.max_windows_undo preference and enter the desired value (3 is the default, I set mine to 10).

To remember more closed tabs per window:

(D) Double-click the browser.sessionstore.max_tabs_undo preference and enter the desired value (10 is the default, I set mine to 20).

Please be cautious in experimenting with sessionstore preferences to avoid disabling this feature. Feel free to ask about anything.

more options

jscher2000 thank you very much indeed for your answer. Could you please tell me what I need to do with these .js files? I've had the window in question open for several weeks, if not months, so I hope I'll manage to restore it.

more options

Generally speaking, you have two options. Sorry this isn't easier...

"Roll back" Firefox to an earlier session history file.

The way you do this is to shut down Firefox, hide all its existing session history, then copy the old file into your profile folder and name it sessionstore.js so Firefox uses that at startup. Users say it doesn't always work, but it's the only current way to feed an old session to Firefox.

If "session state" is important -- the cookies in effect at that time -- then this is your best option.

The detailed steps for the "swap" were in this post: https://support.mozilla.org/questions/1144076#answer-929701

Extract the URLs from the old file and click each link to load it manually

This is a better approach when you need to examine a number of files and you don't want to lose your current session.

One-time Setup:

(0) Install the "Session Extractor" bookmarklet (see the instructions in the top bar of the page for how to install it):

https://www.jeffersonscher.com/res/sumomarklets.html#SessExtr

To Extract the URLs:

In the folder where you copied your session history files for safekeeping:

(1) Create a copy of the session history file you want to mine for URLs and rename it with a .json extension.

For example, right-click the recovery.js file, choose Copy, then right-click a blank area of the list and choose Paste.

Note: By default, Windows hides the .js extension. This is all easier if you can see it. http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions

Right-click > Rename the recovery - Copy.js file to recovery.json (or recovery.txt if you prefer).

(2) Open the recovery.json file in a Firefox tab. Either drag the renamed file and drop it on an existing page to load the json/txt file in its place, or right-click the file and choose Open With and use Firefox.

(3) In the tab displaying the session history file, click the bookmarklet button to run the script. This should generate a new page listing the URLs of each open tab from the file. You can select and copy this list and paste it somewhere for safekeeping, and/or you can just use the links now.

Unfortunately, if you want to save that page "as is" (as an HTML page), there's an extra step: press Ctrl+U to launch the "view source" page, and save that as a .htm or .html file. For some reason, saving the original page gives you the original session file instead of the formatted list of links.

more options

Hi again jscher2000,

unfortunately it didn't work. Thank you very much for your advice though, it will definitely prove very useful in the future.

more options

Hi Andonis, when you say "it didn't work" do you mean technically, you weren't able to get the URLs, or the URLs didn't have what you were looking for?

more options

Basically, I couldn't install the bookmarklet at all and when I open the recovery.json file it's a chaos. I couldn't advance after step 2.

more options

Andonis said

Basically, I couldn't install the bookmarklet at all and when I open the recovery.json file it's a chaos. I couldn't advance after step 2.

You're right, session history files are not formatted for humans to read.

Sorry to hear about the difficulty installing the bookmarklet. I tried to make it as easy as possible. Were you dragging the button to the Bookmarks Toolbar, or using right-click > Bookmark This Link?

If necessary, you can run the script manually.

The pop-up blocker may prevent it from displaying the list in a new window, so you might need to do this once, then approve popups, close the extra tab, and do it again.

After opening the recovery.json file in a tab, open the Web Console in the lower part of the tab using either:

  • Ctrl+Shift+k
  • "3-bar" menu button > Developer > Web Console
  • (menu bar) Tools > Web Developer > Web Console

Select and copy the following script (all one long line)

function scrub(t){t = t.replace(/&/g, "&amp;"); t = t.replace(/>/g, "&gt;"); t = t.replace(/</g, "&lt;"); t = t.replace(/"/g, "&quot;"); t = t.replace(/'/g, "&apos;"); return t;} try{var jsonObject = JSON.parse(document.body.textContent); if (window.confirm('Extract session URLs?')) var newwin = window.open();}catch(err){alert('There was an error in the structure of the session history data:\n\n' + err);} if (newwin){newwin.document.write('<!DOCTYPE html>\n<html><head><title>Session Contents</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">.urllist>p{margin-left:2.25em}.urllist>p:nth-of-type(1){margin-left:0}</style></head>\n'); newwin.document.write('<body><h1>Session Contents</h1>\n'); var out = new Array(); for (var i = 0, windows = jsonObject.windows; i < windows.length; i++) {out.push('<h2 style="border-bottom:1px solid #000">Window ' + (i + 1) + '</h2><div style="margin-left:2.25em">'); for (var j = 0, tabs = windows[i].tabs; j < tabs.length; j++) {out.push('<h3>Tab ' + (j + 1) + '</h3>\n<div class="urllist">'); for (var entries = tabs[j].entries, k = entries.length - 1; k >= 0; k--) {if (k == entries.length - 2) out.push('<p>&larr; Back <em>(earlier pages visited in this tab)</em>:</p>'); out.push('<p><strong>' + scrub((entries[k].title || "[Title Not Available]")) + '</strong><br><a href="' + entries[k].url + '" target="_blank">' + scrub(entries[k].url) + '</a></p>');}out.push("</div>");} out.push("</div>");} newwin.document.write(out.join("\n")); newwin.document.write('\n</body>\n</html>'); newwin.document.close();}

Paste the script into the command line at the bottom of the web console and press Enter to execute it. Either a new tab will open with a readable history or Firefox's popup blocker will intercept it and you'll need to approve popups for the file, close the new tab that just has a copy of the original data, and run the script again.