Sunday, May 25, 2008

How to save your last sessions when Firefox dies

Here is what it happened: the Firefox (in my case, portable) died (a.k.a frozen or not responding) suddenly when I enter a web site. When I killed (what a cruel term to use) the Firefox and restart it again, I chose to restore the sessions before it went haywire. Then, it froze again, in the same way as the previous time. I have opened many interesting pages in separate tabs. I really hate the idea of having to look for them from scratch gain.
Here is what I have done to save my other sessions. Please remember to make a copy of the file (sessionstore.js) you are going to edit before doing anything.
  1. go to "data\profile" under the directory of Firefox.
  2. open the file sessionstore.js with a text editor
  3. find the record of the evil session (look for the URL, the address)
  4. the session that should have caused the problem is recorded in the form of "{entries:[{url:"http://...", where the part starting with "http://" is the address you last viewed
  5. find the matching bracket to "{" and delete from there to the "{" in step 4
If the above steps are of no problem, then you can start Firefox again. There you should get all other sessions reopened, except the culprit.
Readers who have this far probably have problems with step 5, because the file sessionstore.js is written in a whole single line. If you can find an editor that can match brackets of all kinds ("()", "{}", "[]"), things will be easy. As always it is, notepad of Windows does not have this feature. Notepad++ and Sakura in "Free text editors" can do the trick.

No comments:

Search the Web