为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Trying to restore a session within a session from backup file manually

more options

My power died recently, after which I opened Firefox, expecting to be greeted with the about:sessionrestore page but it was just a blank white page for some reason. The tab name still had "about:sessionrestore" but it was just blank, no window to select and restore. I backed up the sessionstore-backups folder and found the session I need to restore (recovery.jsonlz4). I dunno why, when I uncompressed that file, it saved that broken session as well. So the file looks like {Session with broken about:sessionrestore page -> Broken about:sessionrestore tab -> Session I want -> Tabs I want}

Is there any way to manually restore this nested session? I attached some images to help clarify. I don't really know how to work with json files, I'm using a freeware viewer to read the uncompressed session file. Thanks for any help.

My power died recently, after which I opened Firefox, expecting to be greeted with the about:sessionrestore page but it was just a blank white page for some reason. The tab name still had "about:sessionrestore" but it was just blank, no window to select and restore. I backed up the sessionstore-backups folder and found the session I need to restore (recovery.jsonlz4). I dunno why, when I uncompressed that file, it saved that broken session as well. So the file looks like {Session with broken about:sessionrestore page -> Broken about:sessionrestore tab -> Session I want -> Tabs I want} Is there any way to manually restore this nested session? I attached some images to help clarify. I don't really know how to work with json files, I'm using a freeware viewer to read the uncompressed session file. Thanks for any help.
已附加屏幕截图

所有回复 (3)

more options

You may have corrupt sessionstore [v56] sessionstore.jsonlz4 file(s). Delete all sessionstore* files and the sessionstore-backups folder.

Don't delete the files if you need to rescue any data from them, just move them out of the profile folder to some location where Firefox doesn't look for them. You can try to read out their contents using this tool: https://www.jeffersonscher.com/res/scrounger.html


Type about:support<enter> in the address bar.

Under the page logo on the left side, you will see Application Basics. Under this find Profile Folder. To its right press the button Show Folder. This will open your file browser to the current Firefox profile. Now Close Firefox.

Windows: Show Folder; Linux: Open Directory; Mac: Show in Finder

Linux: Under the page logo on the left side, you will see Application Basics. Under this find Profile Directory. To its right press the button Open Directory.

Locate the above file. Then rename or delete it. Restart Firefox.

more options

@FredMcD

I'm not sure you actually read my post completely. I am already past the steps you described. I have the session file backed up already and it is readable. What I want to do is edit the .json file so that FF reads the inner session instead of the corrupted outer layer. Trying to restore it as it currently is makes the blank about:sessionrestore come up every time.

由Typo3000于修改

more options

One of the options on the Scrounger page is to save out the first embedded session found in the JSON. Is that button enabled? If not, perhaps my code isn't detecting it correctly, or maybe due to lack of regular testing it no longer works:


Manual Extraction

If you viewing your JSON file in a Firefox tab, you could switch to the "Raw" view and try running this in the web console (Ctrl+Shift+K). Since I don't have immediate access to a file like yours, I don't know whether it will work:

// First, you need to be in the "Raw" tab of the Fx JSON viewer
// Find the JSON content
var s = document.querySelector('#rawdata-panel div.panelContent pre.data');
// Extact the content and work with it as a JSON object
var s1 = JSON.parse(s.textContent);
// Identify the object property containing the embedded session
var s0 = s1.windows[0].tabs[0].formdata.id.sessionData;
// Pop up a prompt with the JSON text of the embedded session
prompt('Extracted', JSON.stringify(s0));


If the code is very long a prompt window isn't going to be large enough and you may need to dump it out somewhere else.