Prevent Yourself From Accidentally Quitting Firefox Or Chrome

Prevent Yourself From Accidentally Quitting Firefox Or Chrome

You know when you mean to press Control/Command+W to close a tab or window but accidentally hit Control/Command+Q to quit the browser? That sucks, but you can enable protection in both Firefox (all platforms) and Chrome (Mac) so you can catch your mistake before it causes any trouble.

Chrome’s solution is really the more elegant one, but unfortunately it’s Mac-only. Basically, you just go to the Chrome menu and choose “Warn Before Quitting”. Selecting this option will require you to press and hold down Command+Q in order to quit so an accidental keystroke won’t be the end of your browsing session.

If you’re using Firefox you can turn on protection regardless of your operating system, but you may have to enable a secret config option. Here’s what you need to do:

  1. Open Firefox’s Options/Preferences, go to the Tabs section, and make sure “Warn me when closing multiple tabs” is checked.
  2. In Firefox’s address bar, type about:config and accept the warning it gives you.
  3. This will present you with a long list of config options. Use the filter up top to filter by warnon and make sure all the warnOnWhatever (e.g. warnOnQuit, warnOnRestart) toggles are set to true.
  4. Now change the filter to quit. You’ll see another toggle called showQuitWarning. Make sure that’s set to true as well.

If you only have a single window open, this won’t warn you when quitting. If you have multiple tabs open, however, Firefox will now always provide an alert if you try to quit, protecting you from any unwanted accidents.

Yes, this is really more shortcut accident insurance than an actual shortcut, but it can save you a bunch of time if you’re prone to mistakenly quitting your browser.

Shortcut of the Day highlights a great shortcut on various platforms from the desktop to mobile devices to the web. You can find more shortcuts here.


  • Chrome extends the ctrl-shift-T shortcut for re-opening closed tabs to entire sessions. If you accidentally close a chrome window, opening a new one and hitting ctrl-shift-T will bring back all of the tabs that you just accidentally closed.

  • Hmm,.. the “last tab close” addon for “Firefox” cures this issue. It allows you to close the last tab of FF without it closing the whole browser. If you’ve accidentally closed a page, you can right click the page tab, and select “undo close tab”. A bit easier than messing around in the config… 🙂

  • So really Firefox’s way is just as elegant? You’re only going into the config there to check, not to actually change anything.
    And it works cross-platform. I’d say Firefox is the winner here.

  • now THAT was some big help, thanks a lot!! i had alle warnOnXYZ values set to true, but the showQuitWarning was false. how did mozilla even come up with such a preset?? doesn’t make sense to me to have a warnOnQuit setting which actually can be set via the preferences, but which is overridden by another showOnQuit value…

    anyway, thanks. the video explains everything perfectly.

Show more comments

Log in to comment on this story!