Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox loses my tabs and tab groups

  • 14 majibu
  • 16 wana tatizo hili
  • 1 view
  • Last reply by sadlsor

more options

I closed down my system normally last night. Firefox closed down. When I started up Firefox this morning all of my tabs and tab groups had gone - AGAIN!

Firefox has done this to me several times and I have never been able to recover my tabs and groups by any of the methods described previously. I am currently using FF 29.0.1 on Windows 7 Ultimate. This loss of tabs and groups has happened in exactly this way on several previous occasions over quite a few years with different versions of FF.

My history is still present.

Leading up to this I have noticed that FF 29.0.1 was not faithfully preserving tab states. There have been several tabs where, during a session, I have changed the URL that the tab was pointing to only to find that FF has preserved the original URL for that tab when I have restarted it the next morning.

I have come to suspect that what is happening is:

   1) FF saves the tab and groups state in sessionstate.js on close down (and at intervals while running). It creates sessionstore.js with a syntax error in it.
   2) On start up FF loads sessionstore.js, hits a syntax error, (silently) decides that it can't use that store and creates a new one, thereby losing all information in the previous sessionstore.js.

When I save the new sessionstore.js as something else, rename sessionstore.bak to sessionstore.bak.js and then double click it to launch it I get an error dialog:

Line: 1 Char: 11 Error: Expected ';' Code: 800A03Ec Source: Microsoft JScript compilation error.

Here are the first few characters of the file:

   {"windows":[],"selectedWindow":0,"_closedWindows":[{"tabs":[{"entries":[{"url":"http://php.net/",

The frustrating thing is that I (think I) can see data in there relating to my tabs and groups. Because the JS is minified it's almost impossible to extract the data structures in a meaningful way. Because the file is so large (>2.9MB) and the syntax error my code editors can't make any sense of prettifying it so it's very difficult to pull apart.

I question the use of JS for preserving data in this way. There may be performance reasons for using JS. Wouldn't it be better to use something like XML? At least us poor humans would have a chance of eyeballing the data and doing a manual recovery if necessary. Sod it! We could even write a program to load up the tabs ad groups from the XML!

I have wondered about using Firefox Sync for all of my systems. My worry is that a problem on one machine will blow away my settings on all of them. Does anyone have any experience with respect to FF Sync in this respect?

I've preserved copies of my sessionstate.bak (along with the previous one) in the hope that someone may have a way of recovering the tab and group information contained in there.

If anyone has any suggestions about recovering the tab and group information I'd be really glad to hear them. I can't say loudly enough how frustrating it is to keep losing the tabs and groups. Each time it happens it blows away the context of the several jobs that I'm doing at any one time.

Oh. And I'm writing this message using Chrome as my browser.

I closed down my system normally last night. Firefox closed down. When I started up Firefox this morning all of my tabs and tab groups had gone - AGAIN! Firefox has done this to me several times and I have never been able to recover my tabs and groups by any of the methods described previously. I am currently using FF 29.0.1 on Windows 7 Ultimate. This loss of tabs and groups has happened in exactly this way on several previous occasions over quite a few years with different versions of FF. My history is still present. Leading up to this I have noticed that FF 29.0.1 was not faithfully preserving tab states. There have been several tabs where, during a session, I have changed the URL that the tab was pointing to only to find that FF has preserved the original URL for that tab when I have restarted it the next morning. I have come to suspect that what is happening is: 1) FF saves the tab and groups state in sessionstate.js on close down (and at intervals while running). It creates sessionstore.js with a syntax error in it. 2) On start up FF loads sessionstore.js, hits a syntax error, (silently) decides that it can't use that store and creates a new one, thereby losing all information in the previous sessionstore.js. When I save the new sessionstore.js as something else, rename sessionstore.bak to sessionstore.bak.js and then double click it to launch it I get an error dialog: Line: 1 Char: 11 Error: Expected ';' Code: 800A03Ec Source: Microsoft JScript compilation error. Here are the first few characters of the file: {"windows":[],"selectedWindow":0,"_closedWindows":[{"tabs":[{"entries":[{"url":"http://php.net/", The frustrating thing is that I (think I) can see data in there relating to my tabs and groups. Because the JS is minified it's almost impossible to extract the data structures in a meaningful way. Because the file is so large (>2.9MB) and the syntax error my code editors can't make any sense of prettifying it so it's very difficult to pull apart. I question the use of JS for preserving data in this way. There may be performance reasons for using JS. Wouldn't it be better to use something like XML? At least us poor humans would have a chance of eyeballing the data and doing a manual recovery if necessary. Sod it! We could even write a program to load up the tabs ad groups from the XML! I have wondered about using Firefox Sync for all of my systems. My worry is that a problem on one machine will blow away my settings on all of them. Does anyone have any experience with respect to FF Sync in this respect? I've preserved copies of my sessionstate.bak (along with the previous one) in the hope that someone may have a way of recovering the tab and group information contained in there. If anyone has any suggestions about recovering the tab and group information I'd be really glad to hear them. I can't say loudly enough how frustrating it is to keep losing the tabs and groups. Each time it happens it blows away the context of the several jobs that I'm doing at any one time. Oh. And I'm writing this message using Chrome as my browser.

Modified by Carcajou

All Replies (14)

more options

What have you tried for session recovery so far?

3MB is quite large and may well indicate some corruption. Still, since as you can see it is largely text, you often can extract the URLs. Doing that by hand would be arduous...

I assume you have seen the following links in other threads mentioning data mining techniques to rescue the URLs from the sessionstore.js or sessionstore.bak file:

Do any of those work on your file(s)?

more options

Note that you can open a sessionstore.js file in the Scratchpad and click the Pretty Print button to prettify the content for easier inspection. Then you can at least see if the file is OK.

more options

Thank you for your replies. Here's what I've tried:

I tried "about:sessionrestore" and got the page, "Well, this is emabarassing." The list of Windows and Tabs is empty so there's nothing to remove that might fix the problem.

This, I guess, isn't exactly surprising, since it's using a brand new sessionstore.js that it's created from scratch.

So, to explore my hypothesis:

  • Make a safe copy of my sessionstore.bak
  • Shut down FF, log out, log back in again.
  • Delete the current, empty-of-tabs-and-groups, sessionstore.js
  • Copy sessionstore.bak to sessionstore.js
  • Start up Firefox. Starts up with a single, Firefox home page tab and no groups.
  • sessionstore.js is 510 bytes. sessionstore.bak is 2,907kB.
  • Open Scratchpad and then open sessionstore.bak and prettyprint it.
  • Wow! Now I can see data and, at the end,
     /*
     Exception: missing ; before statement
     */
  • So I'm still guessing that the problem arises because FF writes a sessionstore.js with syntax errors in it. That causes it to choke when it next starts up and it creates an 'empty' one.
  • Using Scratchpad to collapse everything from the 1st opening '{' (the very first character in the file) leaves me with something that looks like this:

{<-->},

                 'https://www.google.co.uk':{
                      'web::c': '[]',
        which would seems to violate JS syntax.

Can you point me as to where to look for my groups? At the moment I can't spot the data structures that manage groups. I've tried searching for the title of one of my groups and I can't find it.

I have to go out for a while now. I probably won't be back until tomorrow (NZ time). Thank you very much for your pointers so far. I appreciate the quick response and the valuable help. I'll try the data mining tools.

more options

As a test I created a new Firefox profile and browsed a few tabs splitting them into two groups. I copied the contents of the sessionstore.js file into http://jsbeautifier.org/ to lay it out a bit better and saved it on Pastebin: http://pastebin.com/rEmT3rYz

Based on that, it appears that for each tab in the tabs array, there is an extData object with a groupID number, and within each window at the end there is a extData object where each groupID is associated with the title of the group. It's definitely not easy to read.

Could you check your sessionstore.bak data in these sites? Maybe they will be more helpful in identifying the issue (e.g., missing character somewhere):

more options

Thank you for your reply. I tried pasting both of my sessionstore.bak files into jsbeautifier.org. In both cases it choked and the page became unresponsive. The files are quite large in terms of bytes, sessionstore.bak_2014-01-10: 5,528,048 bytes and sessionstore.bak_2014-05-31: 2,976,170 bytes. I don't remember how many tabs and groups were in the first one. I think that I had about 9 groups in the second one. I'm guessing that these session files get big very quickly as the store, at least, the history for each tab.

I got the same result with jsonlint.com, the page became unresponsive.

I had a bit more luck with braincast.nl. It came back to me after I had pasted the pretty-printed code into the text box. I clicked on "build tree" and got:

Error console Build tree failed! SyntaxError: Unexpected identifier

but no better indication of where or what the error might be.

I didn't find any miss-matched braces, parentheses or brackets.

However, if I paste the code into http://www.freeformatter.com/json-validator.html and select the option that accepts single-quoted names/keys, the code is accepted as valid JSON.

With a lot of work I have produced the following from the latest sessionstore.bak. I've gone through and isolated (I think) the major data structures in the file and removed the details. You can see where the vast bulk of the file is from the [... n lines snipped ...] comments. 8723 lines!:

   {
       'windows': [
       ],
       'selectedWindow': 0,
       '_closedWindows': [
           {
               [... 8723 lines snipped ...]
           },
           {
               'tabs': [
                   [... 43 lines snipped ...]
               ],
               'selected': 1,
               '_closedTabs': [
               ],
               'width': 1313,
               'height': 1028,
               'screenX': - 1313,
               'screenY': 22,
               'sizemode': 'normal',
               'title': 'Local Web Pages',
               'closedAt': 1400578323207
           },
           {
               'tabs': [
                   [... 157 lines snipped ...]
               ],
               'selected': 1,
               '_closedTabs': [
               ],
               'width': 1378,
               'height': 1028,
               'screenX': 82,
               'screenY': 0,
               'sizemode': 'normal',
               'cookies': [
                   [... 46 lines snipped ...]
               ],
               'title': 'Adobe - Open a Customer Service case'
           }
       ],
       'session': {
           'lastUpdate': 1401448561623,
           'startTime': 1341042329151,
           'recentCrashes': 0
       },
       'scratchpads': [
       ],
       'global': {
       }
   }

I did also try https://firefox-session-restore.herokuapp.com/. It seemed to 'think' for quite a while and then nothing happened. The Help question mark was active so I assume that it had given up.

Are there any options that may be set to have FF issue some error log or debugging log as it starts up?

Again, I appreciate your help with this.

more options

Okay, if this file can't be easily repaired to its original format, it will need to be pillaged for URLs using some other approach. I'm not especially adept at text extraction scripts, but I'll keep this tab open until I have time to work on it..

more options

Thank you. When I get a moment I might have a go at writing some code to see if I can pull it apart or, in particular, find out where the problems are.

I'll post again here if I make any progress.

more options

Do you have Microsoft Word? I'm faster with VBA than JavaScript...

more options

I do have MS Word 2007. I was thinking of using one of the PHP or Python JSON parsers.

more options

Here's a VBA macro to extract the URLs from sessionstore.js. I tested on a small file (250K). Not sure whether it can handle 3MB, but I'll be curious to see how you do. You may want to turn off all proofing in Word before opening sessionstore.js since spellchecking and grammar-checking often crap out on large documents.

http://pastebin.com/iK6x2i1N

I noticed there is an "index" property for each tab indicating which page from history was showing. Usually it was the last page so I didn't take the time to extract it. However, if you didn't want all the full tab history and just wanted the displayed page, you would need to do that.

more options

Thank you for that Jefferson. I'll take a look just as soon as I can. Could you post your small test file to PasteBin so that we have the same test material please?

more options

I might need to create a clean file. I was using my active session file, which is not something I can post.

more options

OK. I understand that. How about I create a known one and send it to you? I'll document it at the same time.

more options

Been using Firefox since ~ ver. 11. Ever since the tab group has been a "feature", I've never been successful at using them. I can create a tab group, but like the original poster, never can go back and find them anywhere. I like the idea, maybe by version 42 they will actually work. %^) I'm no software engineer, just a heavy user.