Paul O’Shannessy

blah. blah. blah.

About That Quit Dialog…

Remember when we turned it off a couple weeks ago? We did that by just flipping the browser.warnOnQuit preference to false. I mentioned that you could get old behavior back by flipping that preference back to true. That’s not going to work anymore.

I just landed bug 629485 to change things again, so pay attention. When we turned off the quit dialog, we took away any way of stopping the last window from closing without any warning, even if you explicitly set the visible pref browser.tabs.warnOnClose which would show the window closing warning (when you have multiple tabs). That wasn’t so cool. So we played around with the logic and made that possible. But in order to do so, we had to change the default value of browser.warnOnQuit to true and create a new preference which controls the quit dialog (browser.showQuitDialog). I know this sounds a bit inane, but there really wasn’t a better way to do it and maintain browser.warnOnQuit == false as an override.

It’s all a bit confusing, so I’ve documented the conditions under which we won’t show a dialog, as well as the rules for choosing which dialog to show. Some of that comment is perfectly clear; the rest requires a little bit of understanding of the code (but it shouldn’t be too hard to figure out if you want).

Don’t expect me to write another post like this. I don’t expect any further changes to how this stuff works.


  • We enabled the window closing dialog when closing the last window would otherwise just quit (mostly important to Windows and Linux users).
  • If you want the quit dialog back, set browser.showQuitWarning to true and make sure browser.warnOnQuit is also true.

Update: Feb. 8, 2011: Yup. I fucked that up a little bit. We aren’t showing the quit dialog if you close the last window, even with the prefs mentioned above. That should be fixed in the next nightly.

Just Quit It

For a long time now, if you didn’t have Firefox set to restore your session then Firefox would prompt you before quitting. A dialog with 3 buttons and a checkbox. It looked like this:

That mostly just gets in your way though. You’ve already decided you want to quit. You don’t also need to decide if you want to reopen your tabs next time. So starting with the next nightly (January 21st) and Firefox 4 beta 10, you will no longer see that prompt. Of course if you already checked the box to “not ask next time” you weren’t seeing this anyway.

Essentially, all we did was flip a preference that has been there since Firefox 3 (that was almost 3 years ago for those of you keeping track at home). browser.warnOnQuit was added as hidden preference to override other conditions that might cause a dialog shown at quit. We set that to false. If you want Firefox 3.* behavior, then just flip the pref back to true.

If you’re interested, this was done in bug 592822 (it was originally planned as part of bug 588482).

Dude, Where’s My Session?

I know it’s been a while since I wrote about it, but it’s now possible to restore your session on demand after startup. There is work underway to make that feature more visible, namely bug 593421 (to add a button on the start page) and bug 589665 (to add a button in Panorama).

Update (Feb. 7, 2011): We had to make some further changes. We kept the dialog turned off by default but had to do some work with preferences. Setting browser.warnOnQuit is no longer good enough to show the quit dialog. Read more

Apparently Amazon is stepping right into HTML5 and using type="email" in their sign in form. You can see the built-in form validation in action there. This is pretty awesome to actually see out in the wild, especially from such a big name.

Client-side form validation without various JS libraries is pretty cool. Read more about it.

Apparently Amazon is stepping right into HTML5 and using type="email" in their sign in form. You can see the built-in form validation in action there. This is pretty awesome to actually see out in the wild, especially from such a big name.

Client-side form validation without various JS libraries is pretty cool. Read more about it.

<3 Firefox Sync

Today I accidentally deleted my primary Firefox profile (mostly through user error). I was cleaning testing profiles out via the Profile Manager and managed to delete default. Since that actually deletes the whole profile folder from disk instead of moving to the trash can, I just said “Fuck”. This is a profile I’ve had for a while. It had a lot of history, passwords, bookmarks, extensions. All of it lost in an instant.

Luckily though, I’d set this profile up to use Firefox Sync years ago when early versions of Weave were just being released. At that point I’d set it up for backup primarily. Since then I’ve synced that profile to multiple computers.

The nice thing about it is I lost almost 0 time. I created a new profile, set up Sync, and within a couple minutes had the vital information I needed in my profile. I lost a couple things: extensions, some prefs. I don’t use many extensions so that’s not a huge issue. I don’t even remember what prefs I’ve tweaked, but I’m going to guess not too many. Some prefs were restored by Sync, but there’s only a handful that get synced. I even had all of my tabs a click away on the list of tabs from other computers.

If you’re not using Firefox Sync, it’s built in to Firefox 4 and is also available as an extension.

Cascaded Session Restore + a Hidden Bonus

In the tradition of announcing major things on Friday nights…

I did this thing where we don’t load all of your pages at once when we restore your session. That should keep your Firefox (and computer in general) a bit more usable when you start up Firefox with a large session. See bug 586068 if you’re interested in the juicy details.

Other Details

  • Switching tabs should cause the selected tab to start loading immediately, even if it wasn’t loading before
  • This works with Panorama (so changing groups re-prioritizes your load order).

Preference Controlled

We load a certain number of tabs based on the browser.sessionstore.max_concurrent_tabs preference. We’ve set the default to 3 for now.

Hidden Bonus

Set the pref to 0. It’s basically a built-in BarTab.


We show the page title and favicon at start up, before we try to load the page. So you might see some slightly odd behavior. Panorama’s thumbnail caching isn’t perfect, so there will probably be missing thumbnails at start up if you switch into the Panorama view.

Please email me (link below!) or file a bug blocking 586068 if you see anything weird.

Restore Previous Session

I landed bug 588482 today (September 10th), so starting with tomorrow’s nightly version of Firefox (AKA Minefield), you’ll be able to restore your previous session at any point after start up. This means that you no longer have to restore your whole session immediately at start up. This will be available through a menu item in the History menu, as shown below.

Screenshot of History Menu

This feature will be in Firefox 4 beta 6 beta 7, due out in the next couple weeks.


  • Restoring your previous session after you’ve browsed around will merge the sessions. You shouldn’t lose any new data by restoring your previous session.
  • We didn’t break existing behavior. If you have Firefox set to show your windows and tabs from last time, we’ll continue to do so and you won’t even notice this feature exists
  • App tabs still behave the same.
  • This doesn’t break any existing APIs, but it does add some new ones.
  • Discoverability is suboptimal.
  • You are still prompted to save your session when quitting (assuming default prefs).


We did this primarily for 2 reasons.

  1. We want faster start up times. By encouraging users to always resume their previous sessions, we give the impression that Firefox takes a long time to load up. But really, you’re loading 20, 50, 100+ tabs and that’s what is slow.
  2. When you’re quitting, you there’s a good chance you have no idea if you’ll need your tabs next time.

(Keep in mind, if you’re reading this post, you aren’t the typical user. You’re probably a developer of some sort who drags your 400 tabs around to each session. You know it’s slow, but you really never got the hang of bookmarks, so you just keep tabs open.)


Obviously, in order for us to restore your session, we need to save it to disk. We save this data in a plain-text JSON file in your profile.

We currently consider sessions a little differently than some other browsers. We consider your session cookies (and a few other things) as part of your session. This means we write that information to disk. Under a normal session restore that you’ve explicitly opted-in to, that’s fine. We have a hidden preference (browser.sessionstore.privacy_level) that specifies what level of privacy to use. The default value is 1.

There are 3 levels of privacy:

  • 0 = Save private information for HTTP and HTTPS sites.
  • 1 = Save private information for HTTP sites.
  • 2 = Don’t save any private information.

For deferred sessions, we created a new preference (browser.sessionstore.privacy_level_deferred) with a different default value. Since people are not making an informed decision to restore at shutdown, we don’t want to expose information that can be used to, for example, log in to GMail. This new preference has the same possible values but the default value is 2, so that no session cookies will be restored.


Yea. They’ve been doing this for ages. But as far as I know, they still don’t allow you to restore your entire session at start up.