You are here

Mozilla launches improved Session Restore in Firefox 33

I rely a lot on Firefox's Session Restore feature. I have configured the browser to always open the last session when it gets opened and for the most part it works just as advertised.

While there are other methods to ensure that, like bookmarking tabs regularly before you close the browser, it is not really as comfortable of an option as the built-in session restore feature.

With that said, the Session Restore feature of Firefox is far from perfect. While it does a good job normally, I sometimes experienced issues in regards to that.

Sessions would not be loaded but the Firefox home page would. That's a big problem if you rely on the feature as you may not be able to recover all websites that were open during the last browsing session.

You can try and recover sessions, but that may not work all the time. Some users have helped themselves by using third-party add-ons instead like Session Manager which provides you with more control over the whole saving and restoring process.

Mozilla just announced that it has made improvements to Firefox's Session Restore feature that it plans to ship with Firefox 33.

The new feature attempts to minimize data loss in regards to sessions by improving how backups are stored and recovered again.

firefox new session restore

The new backup process

  1. Firefox writes contents of Session Restore to sessionstore-backups/recovery.js whenever it is required.
  2. Before that happens, it will move the previous recovery.js file if tests return it as good to recovery.bak in the same folder.
  3. Usually, recovery.js and recovery.bak contain both the state of the browser 15 seconds apart from each other.
  4. When Firefox is shut down, a new sessionstore.js file is written to the main profile folder.
  5. During start up, if sessionstore.js is valid, it is moved to previous.js in the sessionstore-backups directory.
  6. On the first start up after an upgrade, Firefox copies the sessionstore.js file to upgrade.js-[build id].

The restore files

As mentioned before, Firefox saves several new session restore files to the user profile directory once the new feature lands in the browser (Nightly users already have it as it lands in Firefox 33 if things go as planned).

  • sessionstore.js - The state of the browser during the last shut down.
  • sessionstore-backups/recovery.js - Contains the state of Firefox 15 seconds before shutdown or crash.
  • sessionstore-backups/recovery.bak - Contains the state of Firefox 30 seconds before shutdown or crash.
  • sessionstore-backups/previous.js - Session Restore data before the second to last shut down.
  • sessionstore-backups/upgrade.js-[build id] - Session Restore data after the latest upgrade.

The new process

Here is the order in which Firefox attempts to restore the previous session on start.

  1. If sessionstore.js is valid, it will be used.
  2. Recovery.js will be used if present and valid.
  3. Recovery.bak will be tried next.
  4. Previous.js is then used to restore the session.
  5. And finally, upgrade.js will be tried as well.

So what is different in comparison to the old session restore? First of all, you may notice that additional files are saved by the browser which increases the chance that one of the session restore files is not corrupt and working.

In addition, both the previous.js and upgrade.js files are not replaced as often as the two main session restore files. This provides another option of recovering a session if both primary session files are no longer working, or if you have started the browser several times after you noticed that the session was not restored properly.

The new system offers additional means to recover sessions manually as well. Previously you had to rely on the backup file only to restore a session if the main sessionrestore file was corrupt. Now, you can also try recovery.js or upgrade.js, both of which are usually created farther back in time making it more likely that they are not corrupt as well.

This article was first seen on ComTek's "TekBits" Technology News


Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer