SysTutorials

Prevent Firefox from Closing When Last Tab Closes

· updated April 12, 2026

By default, Firefox closes the entire window when you close the last tab. This can be annoying if you’re used to keeping the browser window open. Here’s how to change this behavior and other useful tab management tips.

Prevent Firefox from Closing: about:config

  1. Open a new tab and type about:config in the address bar
  2. Click “Accept the Risk and Continue”
  3. In the search box, type browser.tabs.closeWindowWithLastTab
  4. Double-click the entry to change it from true to false

Now when you close the last tab, Firefox opens a new blank tab instead of closing the entire window. The change takes effect immediately.

Why Firefox Does This by Default

The behavior matches how most desktop applications work: closing the last document or item closes the application window. For casual users, this feels natural. Power users who manage many tabs throughout the day often prefer the window to stay open, which is why this preference exists.

Alternative: user.js for Persistent Configuration

If you want this setting to persist across Firefox updates and profile resets, add it to a user.js file:

// In your Firefox profile directory
// Find it: about:support → Profile Directory → Open Directory
// Create or edit: user.js

user_pref("browser.tabs.closeWindowWithLastTab", false);

The user.js file is read on every Firefox startup and overrides any changes made through about:config. This is useful for managed environments or when you want to ensure your preferences survive profile resets.

Other Essential Tab Preferences

While you’re in about:config, these related settings improve tab management:

Move new tabs next to the current tab (instead of at the end):

browser.tabs.insertRelatedAfterCurrent = true

Warn when closing a window with multiple tabs:

browser.tabs.warnOnClose = true
browser.tabs.warnOnCloseOtherTabs = true

Enable tab previews on hover:

browser.tabs.cardPreview.enabled = true
browser.tabs.cardPreview.delayMs = 500

Control where new windows open:

browser.link.open_newwindow.restriction = 0

Keyboard Shortcuts for Tab Power Users

Master these shortcuts to manage tabs efficiently:

Tab Management Extensions

Firefox extensions that enhance tab handling:

Firefox Container Tabs

Containers are a built-in Firefox feature (enhanced by the extension) that let you separate browsing contexts:

Right-click the New Tab button or use the Containers extension to open a tab in a specific container.

Memory Management with Many Tabs

If you tend to accumulate tabs, Firefox has built-in memory management:

For extreme tab hoarders (100+ tabs), consider using bookmarks instead. Ctrl+D bookmarks the current tab, and you can organize bookmarks into folders for later access.

Quick Reference

← All posts