Extracting open URLs from sessionstore.js?

User Help for Mozilla Firefox
Posts: 6
Joined: March 6th, 2005, 9:47 am

Post Posted September 13th, 2012, 12:32 am

trolly wrote:If you had several windows open you get multiple "windows" entries.
"tabs" defines a tab and the "url" entries describe the complete stored history of that tab.

BTW: This extension (NightlyTesterTools adds a "Restore from last session" entry to the history menu. I forgot about it. :oops:
If you have it just create a new session and restore the tabs using that menu item.

Thank you very much trolly, that extension did the trick and my older sessions suddenly re-appeared :)


Post Posted September 14th, 2012, 1:10 pm

You can list all opened tabs in CLI with this python script :

Code: Select all

import json, sys
f = open(sys.argv[1], "r")
jdata = json.loads(
for win in jdata.get("windows"):
    for tab in win.get("tabs"):
        i = tab.get("index") - 1
        print tab.get("entries")[i].get("url")

You need to adapt the first line for windows with your python path.


Post Posted October 15th, 2012, 6:02 am

I had a similar problem.
After a crash, FireFox didn't seem to be able to read the contents of the sessionstore.js (restored from a sessionstore.bak).

After hours of research and failed attempts, I came across this post:

It turns out that the inner structure of my sessionstore.js file got screwed and all my tabs ended up in the _Closed_Windows section of the file. The solution was fairly simple. I just used to restructure the sessionstore.js file. It's a nice intuitive JSON editor, which allowed me to drag and drop the content from _ClosedWindows to windows).

Having edited the sessionstore.js file in this way, I copied it back to the FireFox profile folder, restarted the browser and bingo! Tab-whoring as usual now! :lol:

Props to dag from!

Posts: 6
Joined: April 11th, 2013, 1:50 pm

Post Posted April 15th, 2013, 8:54 am

how is the id in a sessionstore.js is related to places.sqlite??

when i see the id's in a js file it is not even matching with the places.sqlite database.How to find it??

Posts: 1
Joined: June 30th, 2013, 3:59 pm

Post Posted June 30th, 2013, 4:10 pm

Run into the problem of FF not loading the .js file despite repeat attempts at restoring that and the .bak. Looking at the file in notepad, there don't appear to be any problems with the closed windows/tabs section that other users have reported, looks quite normal and has checked out ok with JSON verify. Firefox just keeps overwriting it and there is nothing in about:sessionrestore.....
There are about 900(!) tabs in that file essential for my work, and what I really need is a way to extract the urls quickly, preferably outputted to an html file with clickable links, otherwise it'll probably take a week to restore everything. I've tried the various methods on these pages, but nothing works, but that may be due to my inexperience with perl, java, php etc.
Can someone do a really dumbed down step by step method, or point me in the direction of one or a tool or something?

Return to Firefox Support

Who is online

Users browsing this forum: No registered users and 16 guests