fixing your desktop programming

Fixing Firefox: Prevent it quitting and losing all your work

Are you having this problem?

“I tell Firefox to ask before quitting, but it always quits without asking”

Especially on Macs, where cmd-w (close tab) and cmd-q (close window) are immediately next to each other…


It looks as though Firefox won’t fix this. It’s been 3 years, and it’s been reported to them plenty.

In the meantime… I found one solution that *does* work:

Plugin: “Always Ask” (tested on OS X Mountain Lion, with Firefox 16 – works fine)

Background / history

I find it interesting. The developers decide to remove features – but seem to have misunderstood how/why those were important to the userbase.

Fortunately, the Firefox team are extremely open with their process. Anyone can see the reasoning and the debate that goes into each change – and can comment on it themselves with their own feedback.

So, reading the bug reports on, you can build up a picture. My impression – based on reading a bunch of these reports over the past few years – is that it went something like this:

  1. “The ONLY reason someone would want to “not quit” is because they lose all open tabs”
  2. “We’ve changed Firefox so that it re-opens all tabs by default, all the time”
  3. “Therefore: we can remove the feature”

That’s pretty sound reasoning. Although (and I’m not sure why?) … it seems they forgot to remove the GUI that lets users *insist* on the original behaviour, and to remove the three about:config flags that let advanced users fine-control it. Those are all still there, but they don’t work (any more).

But … by browsing the open bug reports, we find a bunch more reasons why Firefox had the original feature (just a sampling from what I read) :

  1. Accidentally closing would lose your set of opened-tabs (OK, they understood that one!)
  2. Firefox has disabled long-term disk caching for the past 4+ years – this is a basic feature of web-browsers, but to workaround bugs in their implementation, where data could get corrupted, Firefox mostly disabled it. It’s proving a long and difficult task to fix it, partly because the rest of the browser has changed so much in that time, and partly because the original implementation was poorly designed (I’ve been watching the bug thread for 3+ years now)
    • …so, when you restart Firefox, ALL your data has to be re-loaded from the web.
  3. If you’re offline when you accidentally quit: BANG! You (often) lose EVERYTHING.
  4. Even if you’re online: Firefox reloads every page. This can take a lot of bandwidth, and a minute or more to complete on broadband … on dialup, or tethered iPhone, it can take minutes or tens of minutes
  5. Some webpages WILL NOT reload after quitting, as a security precaution (for instance: internet banking). If you were typing into a form … the data there is lost, forever, with no workaround
  6. On Macs / OS X: the “close tab” shortcut (used hundreds of times per day) is adjacent to the “quit Firefox” shortcut (used rarely)
    • …OS X has a feature where you can re-assign those shortcuts. If you use this feature, Firefox IGNORES THE OPERATING SYSTEM, and continues to use cmd-q (although it will allow you to use whatever else you chose “in addition”)
    • On Windows, Linux, etc – the shortcuts are very different, so that it’s very difficult to achieve this. In many versions, it’s impossible – only OS X has a global “kill everything” shortcut for each app

…which explains why people get so angry and frustrated at the removal of this feature from the browser.

In short:

  • ONE reason to do with another Firefox behaviour (the thing that Firefox authors “fixed”)
  • MULTIPLE reasons to do with a major Firefox bug that no-one can fix
  • ONE reason to do with online security (that’s very unlikely to change! The security problem will always be there)
  • ONE reason to do with the design of OS X

I suspect that the most common of these reasons is the Mac-specific one. So it’s very likely that a bunch of Firefox developers – who don’t use Macs – wouldn’t have been ABLE to see the problem for themselves. That underlines the importance of consulting your user-base…