Dette websted vil have begrænset funktionalitet, mens vi gennemgår vedligeholdelse for at forbedre din oplevelse. Hvis en artikel ikke løser dit problem, og du vil stille et spørgsmål, har vi vores supportfællesskab, der venter på at hjælpe dig på @FirefoxSupport på Twitter og/r/firefox på Reddit.

Søg i 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.

Læs mere

Library > History > Recently Closed Windows/Tabs gets Erased on close?

  • 18 svar
  • 1 har dette problem
  • 16 visninger
  • Seneste svar af wynden

more options

I had multiple Firefox windows open in which I had organized different categories of things I was working on. The first window in the group was my primary window, in which I had all of my active projects, which the tabs help me remember to do.

Last night there was apparently a power outage, and when I opened my laptop the windows were out of order, with the primary window at the end of the group. Naturally I kept navigating to the wrong window because of this, so I attempted to close the windows one by one, intending to reopen them in the correct order.

I accidentally closed the last window, however, thus closing Firefox entirely. When I reopened it, the Windows and Tabs history were completely erased (see attachment). Is that supposed to happen? Is there no way to maintain a backup of this history that can be restored, like a snapshot that is generated once a week or so? Moreover, is there no way to recover my closed windows?

I have just done a Windows System Restore, but it had no impact at all on my Firefox windows or history. Is there anything else that I can attempt?

I had multiple Firefox windows open in which I had organized different categories of things I was working on. The first window in the group was my primary window, in which I had all of my active projects, which the tabs help me remember to do. Last night there was apparently a power outage, and when I opened my laptop the windows were out of order, with the primary window at the end of the group. Naturally I kept navigating to the wrong window because of this, so I attempted to close the windows one by one, intending to reopen them in the correct order. I accidentally closed the last window, however, thus closing Firefox entirely. When I reopened it, the Windows and Tabs history were completely erased (see attachment). Is that supposed to happen? Is there no way to maintain a backup of this history that can be restored, like a snapshot that is generated once a week or so? Moreover, is there no way to recover my closed windows? I have just done a Windows System Restore, but it had no impact at all on my Firefox windows or history. Is there anything else that I can attempt?
Vedhæftede skærmbilleder

Alle svar (18)

more options

Are you using "Clear history when Firefox closes" to clear the "Browsing History" ?

more options

No, it's set to remember history. I have every precaution that I can think of in place to avoid exactly this scenario.

more options

Your screenshot doesn't show whether you have enabled "Clear history when Firefox closes" and if enabled what items are cleared. So pleas also provide screenshots that show these specific settings.

To see all History settings, choose:

"Recently Closed Tabs/Windows" are stored as part of sessionstore data in the sessionstore.jsonlz4 file in the profile folder, so if you do not keep them then session restore isn't working. The sessionstore.jsonlz4 file is only present when Firefox is closed and storing session data isn't disabled somehow.

You will normally find these files in the sessionstore-backups folder:

  • previous.jsonlz4 (cleanBackup: copy of sessionstore.jsonlz4 from previous session that was loaded successfully)
  • recovery.jsonlz4 (latest version of sessionstore.jsonlz4 written during runtime)
  • recovery.baklz4 (previous version of sessionstore.jsonlz4 written during runtime)
  • upgrade.jsonlz4-<build_id> (backup created during an upgrade of Firefox)

You can copy a file from the sessionstore-backups folder to the main profile and rename the file to sessionstore.jsonlz4 to replace the current file (make sure to backup the current sessionstore.jsonlz4).

You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.

more options

Okay, when I click the dropdown menu, this is what I had.

more options

cor-el said

You will normally find these files in the sessionstore-backups folder:
  • previous.jsonlz4 (cleanBackup: copy of sessionstore.jsonlz4 from previous session that was loaded successfully)
  • recovery.jsonlz4 (latest version of sessionstore.jsonlz4 written during runtime)
  • recovery.baklz4 (previous version of sessionstore.jsonlz4 written during runtime)
  • upgrade.jsonlz4-<build_id> (backup created during an upgrade of Firefox)
You can copy a file from the sessionstore-backups folder to the main profile and rename the file to sessionstore.jsonlz4 to replace the current file (make sure to backup the current sessionstore.jsonlz4).

Would I be able to find my lost tabs in any of these files, or is it likely to have been replaced already by my current windows?

more options

OK, "Clear history when Firefox closes" isn't enabled, so something else must be causing "Recently Closed Tabs/Windows" to get lost.

Does it help if you set the startup setting in "Options/Preferences -> General" to "Restore Previous Session" ?

more options

"Restore Previous Session" was already checked, so it should have done that automatically.

more options

Normally if Restore Previous Session is enabled and you close the last window, that window is restored automatically and the others are on the Recently Closed Windows list. So I don't think you did anything wrong, but for one reason or another, the system failed you.

Did you already back up those various lz4 files to a safe location to avoid Firefox overwriting them? You can inspect their contents using the Scrounger tool on my website:

https://www.jeffersonscher.com/ffu/scrounger.html

After dropping a file on the box, click Scrounge URLs to extract a list. (It works with moderately sized session history files; huge ones may cause the tab to lock up.)

more options

I could not find any file named sessionstore.jsonlz4, but I found all the rest that cor-el mentioned. And thank you for the scrounger tool. With that I found that two of the upgrade.jsonlz4 files still contain references to my missing tabs. I have copied both of these. Can you advise me on any method that I might use to reinstate them in my active session?

Thank you both very much.

-- Edit: I just noticed that I can save this in sessionstore.js format, so I have done that. Since I did not find anything named sessionstore in the profile folder, should I just copy it into the folder?

Ændret af wynden den

more options

Hi wynden, perhaps I am replying too late, but:

In order to coax Firefox to use sessionstore.js at startup, I think you need to hide the following files/folders. You might not have all of these:

  • right-click sessionstore.jsonlz4 => Rename to sessionstoreOLD.jsonlz4 (more move it out of the profile folder)
  • right-click the sessionstore-backups folder => Rename to sessionstore-backupsOLD

Depending on the number of tabs, it might not be too inconvenient to use the HTML file of links you can save from the Scrounger to open them when needed.

more options

Hi jscher2000,

No, I haven't taken any action, yet. I don't have sessionstore.jsonlz4, but I can easily rename the sessionstore-backups folder. Is this a step that I should take if I attempt to copy the sessionstore.js file I made with your scrounger from the update file back into the Profile folder?

Since the html file shows me what is missing, I can repopulate the tabs manually if need be, but should I try the above first?

more options

It's your call which method will be most efficient for you. If you have other tabs open that you don't want to lose track of, you can bookmark them before doing the rename of sessionstore-backups.

more options

Okay, thanks for your help! I deeply appreciate it!

more options

Hey guys,

So as I said, I didn't seem to have any sessionstore.jsonlz4 file in the Firefox Profile folder. I renamed sessionstore-backups folder to sessionstore-backupsOLD and copied and renamed the update file with all of my tabs to sessionstore.jsonlz4, then transferred that into the Profile folder and restarted my laptop. On restart, I had the attached "session" files in the Profile folder.

Unfortunately, Firefox only opened a single tab when it was launched, and still had nothing in the Windows or Tabs history. Not sure if I missed a step, or if Mozilla has made some change and is no longer referencing the sessionstore.jsonlz4 file... or if some other malfunction is going on.

Ændret af wynden den

more options

A 1.66KB file session history file is quite small. Did it really have all your tabs in it?

If you check in sessionstore-backups, do you now have a previous.jsonlz4 file that matches the size of the update file you had before?

more options

Hi jscher,

The session file that I attempted to restore is actually 3.66mb. It seems to be getting overwritten on restart and replaced with an empty sessions file that is only 1.66kb. Perhaps I am naming it incorrectly. I renamed it as sessionstore.jsonlz4, removing the ".json" first. Then I tried leaving it as sessionstore.jsonlz4.json. Neither of those survived the restart.

more options

Hmm, I've never heard of "sessionstore.jsonlz4.json". I think the two names Firefox will look for at startup (especially when sessionstore-backups is missing) are:

  • sessionstore.jsonlz4 -- with LZ4 compression
  • sessionstore.js -- uncompressed

But I haven't experimented on my own Firefox for a long time, so perhaps something has changed.

more options

jscher,

That was the ticket. I changed the name of the uncompressed file to sessionstore.js and all of my tabs are restored. Cheers, my good Sir. You and Cor-el are the heroes of Firefox.