4

How can I make Firefox 52 warn on quit even if only one tab exists?

browser.showQuitWarning and browser.warnOnQuit is set to true,but they seem not work for the "only one tab" situation

  • There's also a browser.tabs.warnonClose that should be set to true. Is the behavior the same whether you quit from the File menu or Ctrl-Q or the Close X icon? – fixer1234 Jun 27 '18 at 7:13
  • You do not get the "Save & Quit" dialog if you choose "Show my windows and tabs from last time". So apparently, this is by design if you are using that option. – fixer1234 Jun 27 '18 at 7:20
  • @fixer1234 I'm set to "Show my home page",browser.tabs.warnonClose is true as default. "Is the behavior the same whether you quit from the File menu or Ctrl-Q or the Close X icon?" seem all quit way get same behavior. – illiterate Jun 28 '18 at 6:34
  • Do you have startup set to show windows and tabs from the last session? – fixer1234 Jun 28 '18 at 7:48
  • "Do you have startup set to show windows and tabs from the last session?"I'm set to "Show my home page" in startup. – illiterate Jun 28 '18 at 9:25
2

I may have misinterpreted the question in the previous answer. I'll leave it in place in case it's helpful to others landing here.

If you just want to get a warning when you try to quit with only one tab open, Firefox won't do that, unfortunately. It only warns if multiple tabs are open, regardless of warning settings.

If you accidentally quit with just one open tab, you would need to restore it from History in the next session.

1

The "closing with last tab" issue is handled a different way. Rather than issuing a warning, you directly control the behavior.

In about:config, go to browser.tabs.closeWindowWithLastTab and set it to false.

If you delete the last tab, Firefox will remain open and will create a replacement tab with whatever your new tab provision defines. This prevents accidentally closing Firefox, but it also means that closing the tab is no longer a method for quiting Firefox. You will need to use one of the explicit close provisions (i.e., via menu, window "X", shortcut key, etc.).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.