10
May
09

Firefox: Always restore your previous session without the prompt

I often shutdown my machine without closing Firefox. Next time I restart the browser it asks me if I want to resume the previous session.

I always want to restore as the first 5 or 6 tabs are my ‘always open’ apps (GMail, Google Reader, etc,). Clicking ‘Resume Previous Session’ all the time really hacks me off.

Now a bit of Googling turns up innumerable posts about disabling session restore so you always start a new session, but finding information about the opposite behaviour, i.e. always restoring the previous session (without asking) is much harder to find.

In order to raise the profile of this feature, I’m linking to the only other post I know about that talks about this. Ironically I only found this after browsing the source and ‘reverse engineering’ my Google query.

The solution is a bit of a hack as the behaviour I require isn’t directly supported. However Firefox allows extensions to override the default prompt and we can exploit this.

Head to about:config and create a string key ‘browser.sessionstore.restore_prompt_uri‘ and give it a value of ‘javascript:window.close();‘. This tell Firefox that a custom session restore prompt has been provided… which is immediately terminated.

Luckily the session restore code assumes that we want to restore unless the prompt returns otherwise and the net result is no prompt and automatic session restoration.

I hope this takes a little bit of friction out of your day.

Advertisements

2 Responses to “Firefox: Always restore your previous session without the prompt”


  1. 1 Selvan
    November 3, 2012 at 4:10 am

    It didn’t work (I copied and pasted without the quotes). Any other solution? BTW, I now can’t delete the newly created String, only the value was deleted.

  2. November 21, 2012 at 2:25 pm

    Update from my previous post: the string is no longer there and, it seems, the latest version of Firefox now has this feature buit-in as I have not seen it for sometime now.


Comments are currently closed.

%d bloggers like this: