How to make Firefox warn on quit even if only one tab exist?

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.


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.).