MozillaZine


Easiest way to display count of open tabs?

Discussion of general topics about Mozilla Firefox
unbob
 
Posts: 122
Joined: December 13th, 2007, 9:43 am

Post Posted May 18th, 2023, 3:00 pm

I've used the 'Tabs2List' extension for years to obtain the count of my open tabs.

However, that method no longer works after updating to FF v113.0.1.

I'd hoped about:tabs would work but that does not exist.

Any suggestions? TIA

morat
 
Posts: 5646
Joined: February 3rd, 2009, 6:29 pm

Post Posted May 18th, 2023, 4:36 pm

Try searching for an addon.

Search results for tab count
http://addons.mozilla.org/firefox/search/?q=tab+count

...

You can run the following code snippet to display the tab count using the browser console.

Code: Select all
gBrowser.tabs.length;

Instructions:

* open about:config page
* set devtools.chrome.enabled pref to true
* open browser console i.e. menu bar > tools > browser tools > browser console
* copy and paste code into browser console command line
* press enter to run

...

You can create a css counter to display the current tab number in the tab label using the userChrome.css file.

Code: Select all
tabs { counter-reset: alpha 0; }
tab { counter-increment: alpha 1; }
tab label.tab-label:before { content: counter(alpha) ". "; }

Or do something similar in the about:performance page using the userContent.css file.

Code: Select all
@-moz-document url-prefix("about:performance") {
  tbody { counter-reset: beta 0; }
  tr[data-l10n-id="item"] { counter-increment: beta 1; }
  td[data-l10n-id="type-addon"] { counter-increment: beta -1; }
  td[data-l10n-id="type-tab"]:after { content: " " counter(beta); }
}

Remember to set the toolkit.legacyUserProfileCustomizations.stylesheets pref to true, then restart.
Last edited by morat on May 20th, 2023, 8:15 am, edited 1 time in total.

unbob
 
Posts: 122
Joined: December 13th, 2007, 9:43 am

Post Posted May 18th, 2023, 6:07 pm

morat wrote:Try searching for an addon.

Search results for tab count
http://addons.mozilla.org/firefox/search/?q=tab+count


That's the ticket! Decided to go with 'Tab Counter' extension.
https://addons.mozilla.org/en-US/firefox/addon/tab-counter-webext/reviews/

Thanks for the reply!

morat
 
Posts: 5646
Joined: February 3rd, 2009, 6:29 pm

Post Posted May 20th, 2023, 8:24 am

You're welcome.

I like the about:performance page style the best. It adds a number after the "Tab" in the type column.

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 3 guests