How do I get Firefox to run sessionstore.bak as if it is sessionstore.js?
I had a Firefox crash twice in a row so lost my Restore Previous Session option (greyed out). I had a lot of important tabs open! Looking around the forum I think the data on the lost tabs is in sessionstore.js (I have sessionstore.bak too). Both contain a lot of text which looks like it has the information Firefox needs. However when I do File>Open File>filename it opens in a tab as text - how do I gt Firefox to use the data to restore my tabs? Windows7 Firefox 31.0 Thanks for any help...
منتخب شدہ حل
Firefox 31 does create the sessionstore.bak file as a copy of the sessionstore.js file from the previous session. Current releases no longer use the sessionstore.bak file, but store a previous copy in the sessionstore-backups folder. To make use of the sessionstore.bak file you would have to copy this file to sessionstore.js to see if that makes Firefox restore that session. Make sure to backup all sessionstore files.
You can look at this post in this MozillaZine forum thread about inspecting a sessionstore file and possibly extract URLs.
You can open the Browser Console (Firefox/Tools > Web Developer). Paste the JavaScript code in the command line and press the Enter key to run the code.
- Toggle the devtools.chrome.enabled pref on the about:config page to true to enable the command line
See:
اس جواب کو سیاق و سباق میں پڑھیں 👍 1تمام جوابات (7)
Sorry, I changed the question as I was posting it. I'm after help to run either sessionstore.js or sessionstore.bak.
FIRST STEP Back up all the sessionstore files somewhere outside the profile, your Desktop or Documents folders would be suitable.
Unfortunately if you are not aware of the need to back up files, and their potential worth it may be rather late to do anything now. sessionstore.bak is only a temporary copy
There is often an offer to restore these tabs. To see it try keying in to the location bar about:sessionrestore
It is possible to use these files, and manually force Firefox to use a particular file. You will need to do the renaming while Firefox is not running, but remember the files are rewritten at closedown, on occasions you may wish to copy files out of the profile before a closedown.
- Rename the current sessionstore.js , maybe add a number to it sessionstore.js.nnn, and preferably move it outside the profile.
- Choose a file, if necessary copy it back into the profile, give it the name sessionstore.js (If you have a suitable sessionstore.bak already inthe profile just rename it)
It is theoretically possible to edit the files, but I don't think that is recommended, and I have no knowledge of the syntax.
IF some the information is valuable enough AND you the time, patience and backup files it could be worth considering. Or at least looking to see if vital URL s may be retrieved. If sessions have been reopened over a period of months it may be easier & more relevant trawling through sesionstore text than searching history.
Also see
In future consider at least bookmarking important tabs, and backing up those bookmarks manually on a regular basis. That will not preserve the tab state but at least you will be able find the page again.
Also consider sync. But I am not certain how robust that is. Sync has in the past been known to corrupt bookmarks. Never rely totally on sync.
Great answer John99. I got the restore session tab to come up after renaming .bak to .js. Unfortunately it list no tabs despite all that data in the text version. I guess I will have to pick through the text for the links manually :)
Did you backup all the sessionstore files you could find ? I think Firefox can sometimes create numbered copies of sessionrestore files when things go wrong, there is a slim chance you have some other files you could attempt to restore by renaming.
I hoped they would have got back at least some of your tabs. Unfortunately when Firefox crashes there is a possibility the restore files are going to get corrupted.
The one that is often ok is the .bak file available after the very first crash but unless you are already aware in advance of the potential backup and recovery method Firefox may be restarted and the last good file is gone.
A long shot but any chance of looking at the file for obvious corruption, but I suspect just getting information about that is not going to be easy
- see for example this from a web search http://dag.wiee.rs/blog/what-if-firefox-loses-your-tabs
All is not yet lost. There is another method well worth trying. Windows keeps backups of previous versions of files, and that should include the sessionrestore.js & .bak files. That may be able to restore a copy from an earlier date that has some useful information and tabs
Just be careful remembering files get overwritten when doing this.
منتخب شدہ حل
Firefox 31 does create the sessionstore.bak file as a copy of the sessionstore.js file from the previous session. Current releases no longer use the sessionstore.bak file, but store a previous copy in the sessionstore-backups folder. To make use of the sessionstore.bak file you would have to copy this file to sessionstore.js to see if that makes Firefox restore that session. Make sure to backup all sessionstore files.
You can look at this post in this MozillaZine forum thread about inspecting a sessionstore file and possibly extract URLs.
You can open the Browser Console (Firefox/Tools > Web Developer). Paste the JavaScript code in the command line and press the Enter key to run the code.
- Toggle the devtools.chrome.enabled pref on the about:config page to true to enable the command line
See:
Thought I would post a few links about the improved session restore system introduced in Firefox 33
I haven't tried to manually restore anything since then, and that itself is probably an indication that the new system is more robust and reliable.
- A fairly short straightforward blog, but easy to understand and lists the files involved. http://www.ghacks.net/2014/06/27/mozilla-launches-improved-session-restore-firefox-33/
- More background and detail Firefox, the Browser that has your Back[up]
- For completeness, an public Mozilla document, about the issues involved https://wiki.mozilla.org/Firefox/session_restore
John99 کی جانب سے
I had a problem with windows 7 and someone suggested I use CCleaner to solve it. I made sure I UNchecked all the items pertaining to browser's cache, history, cookies, etc. However I failed to realize that they were only check marks for IE and Chrome, but none for Firefox. I started the "procedure" and watched in horror how it started to erase all cookies, history, etc from Firefox. Of course it asked me first "in order to continue, Firefox has to be closed, do you want CCleaner to close it?" I realized too late what was about to happen. Of course, whatever needed to be fixed got fixed, (system tray) but it wiped Firefox CLEAN!. I searched for "restore previous versions", but they were none. I followed your advise and found a sessionstore.bak-DATE, from November of 2014! I said that's better than NOTHING, so I renamed the sessionstore.js to .BAD and first made a copy of the 11/14 sessionstore and then renamed it sessionstore.js. I got everything sort of close to my recent layout, so I can't complain much. Thank you for all your help. Click