21

While using Firefox I want to keep tabs on the number of open tabs (pun intended). Is there a way to quickly get this number while using the browser?

In older versions of Firefox there was a pop up message box "You are going to close 428 tabs. Are you sure you want to proceed?" showing when you attempt to close the browser window. However in the later versions (I am running Firefox 102) it does not show up any more.

On this site I found a related post with an answer for Google Chrome browser that uses Google sync function to get this number by typing a special url in the location string.

There is also a related post on Stack Overflow but the solutions there tend to require some scripting or enabling developer tools that are disabled by default.

What would be an easy way to get the number of currently open tabs in Firefox?

4 Answers 4

27

There are ways to count tabs without any extensions, but they're less comfortable or require manual changes. For example:

  • Right mouse button on a tab -> Select All Tabs -> Right mouse button on a tab again -> there will be Close X button with the number of opened tabs.

  • you could modify the V ("List all tabs") dropdown button to include tab count with custom styling:
#TabsToolbar-customization-target {  
  counter-reset: tabCount;  
}

.tabbrowser-tab {  
  counter-increment: tabCount;  
}

#alltabs-button > .toolbarbutton-badge-stack > .toolbarbutton-icon {  
  visibility: collapse !important;  
}

#alltabs-button > .toolbarbutton-badge-stack {  
  position: relative !important;  
}

#alltabs-button > .toolbarbutton-badge-stack::before {  
  content: counter(tabCount);  
  border-bottom: 1px solid var(--toolbarbutton-icon-fill);  
  color: var(--toolbarbutton-icon-fill);  
  opacity: var(--toolbarbutton-icon-fill-opacity);  
  position: absolute;  
  bottom: var(--toolbarbutton-inner-padding);  
  left: 50%;  
  transform: translateX(-50%);  
  padding: 0 3px;  
}

Check e.g. this answer to learn how to apply the styling.

15

Enable the command line of the Browser Console. Execute the following snippet.

(()=>{
  const { ExtensionParent } = ChromeUtils.importESModule("resource://gre/modules/ExtensionParent.sys.mjs");
  const { tabTracker } = ExtensionParent.apiManager.global;
  console.log(tabTracker._tabIds.size)
})();

NB: The Browser Console command line (to execute JavaScript expressions) is disabled by default. To enable it set the devtools.chrome.enabled preference to true in about:config, or set the “Enable browser chrome and add-on debugging toolboxes” (Firefox 40 and later) option in the developer tool settings.

7

One approach is to re-enable the Firefox 93 behaviour of warning when you close a window with multiple tabs. The setting for this can be found in the Tabs section of the General settings; simply tick the "Confirm before closing multiple tabs" checkbox.

2

This requires an add-on. See the following:

  • Tab Counter
    Add a badge to the toolbar that shows the number of currently open tabs in a window or all windows.

  • Tab Counter Plus
    Shows the number of tabs in each window. Efficient and customizable.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .