cancel
Showing results for 
Search instead for 
Did you mean: 

how to restore the precedent session from a sessionstore.bak file

SOLVED
Highlighted
New Contributor

how to restore the precedent session from a sessionstore.bak file

When I tried to open firefox it automatically updated and supressed the sessionstore.js file. I saved the sessionstore.bak into another folder, closed mozilla, changed the extension bak to js in the "profiles" folder of firefox and opened it again but nothing happened. Though the sessionstore.bak file is 13Ko big and seems to contain all the links of my previous session.

How could I force Firefox to start a session using the information in the sessionstore.bak or .js file as it should?

1 ACCEPTED SOLUTION

Accepted Solutions
Legendary Contributor

Re: how to restore the precedent session from a sessionstore.bak file

Hello lordsilver2, the method you tried is the correct, if doesn't work maybe the sessionstore.bak (renamed to sessionstore.js) is corrupted.

First make a copy of the file (the renamed sessionstore.js) to your desktop and then try to create a new profile and move the copy in the new profile to see if that works. If the file is corrupted it is not sure that the above works.


thank you

9 REPLIES
Legendary Contributor

Re: how to restore the precedent session from a sessionstore.bak file

Hello lordsilver2, the method you tried is the correct, if doesn't work maybe the sessionstore.bak (renamed to sessionstore.js) is corrupted.

First make a copy of the file (the renamed sessionstore.js) to your desktop and then try to create a new profile and move the copy in the new profile to see if that works. If the file is corrupted it is not sure that the above works.


thank you

Site Moderator

Re: how to restore the precedent session from a sessionstore.bak file

Did you check for recently closed tabs and windows with that restored sessionstore.js file?

See also this MozillaZine forum thread.

New Contributor

Re: how to restore the precedent session from a sessionstore.bak file

My way:

  1. Open a sessionstore.js file in a browser. It can be a different browser (Chrome) if you like.
  2. Open Firebug/Inspector.
  3. Type: eval("ss = "+document.body.innerText);
  4. Type: for (var i = 0; i < ss.windows[0].tabs.length; i++) { var ent = ss.windows[0].tabs[i].entries; var last = ent[ent.length-1]; document.write("<a href="+last.url+">"+last.url+"</a>
    "; }

Enjoy all tabs from sessionstore on your screen. You only need to Ctrl-click them one by one.

New Contributor

Re: how to restore the precedent session from a sessionstore.bak file

Hi spidgorny

I'm having the same problem as OP but the other suggestions haven't worked for me. I'd like to try yours but am utterly clueless when it comes to inspector.

Where exactly do I type the text that you suggest? In one of the two white boxes at the bottom of the screen (screen shot attached)? Neither of the white boxes has a cursor, or anything else that makes it patently obvious that text may be entered there. Waaaaaaaaaaay out of my depth here!

2013-06-03-08-01-07-f66a1b.png
New Contributor

Re: how to restore the precedent session from a sessionstore.bak file

@tealady: you're almost there. I've used the Web-Inspector in Chrome, but Firefox Inspector should work as well. Just click on the first tab "Web Console" - there you can type the code. Let me know if it's not working.

New Contributor

Re: how to restore the precedent session from a sessionstore.bak file

@spidgorny, thank you so much for replying.  :-) Not having much luck with that. After typing

eval("ss = "+document.body.innerText);

it returns the message

undefined.

After I enter

for (var i = 0; i < ss.windows[0].tabs.length; i++) { var ent = ss.windows[0].tabs[i].entries; var last = ent[ent.length-1]; document.write("<a href="+last.url+">"+last.url+"</a> "; }'

I get the message

SyntaxError: unterminated string literal.

Am I doing something daft?  :-)

New Contributor

Re: how to restore the precedent session from a sessionstore.bak file

OK, for Firefox the lines are:

eval("ss = "+document.body.innerHTML.replace("<pre>", "").replace("</pre>", ""));

and

for (var i = 0; i < ss.windows[0].tabs.length; i++) { var ent = ss.windows[0].tabs[i].entries; var last = ent[ent.length-1]; document.write("<a href="+last.url+">"+last.url+"</a><br />"); }
New Contributor

Re: how to restore the precedent session from a sessionstore.bak file

  • There's a <pre> and </pre> inside the replace() function, which are being corrupt by the commenting system here.
New Contributor

Re: how to restore the precedent session from a sessionstore.bak file

Okay, the first line of code seems to have worked, but when I enter the second one it returns the messages

for (var i = 0; i < ss.windows[0].tabs.length; i++) { var ent = ss.windows[0].tabs[i].entries; var last = ent[ent.length-1]; document.write("<a href="+last.url+">"+last.url+"</a>
"); }

and

TypeError: ss.windows[0] is undefined

Having computer problems and might not be back on tonight but will check in the morning. Thank you again for your continued help!

2013-06-03-14-07-19-202cb9.png