Loirooriol / tab-counter-plus

Tab Counter Plus - Shows the number of tabs in each window. Efficient and customizable.
Apache License 2.0
42 stars 7 forks source link

Allow to disable the counter #2

Open Loirooriol opened 6 years ago

Loirooriol commented 6 years ago

It seems some people are fine with clicking the browserAction when they want to see the number of tabs, and don't need the counter to be always present: https://github.com/DaAwesomeP/tab-counter/issues/12

Tab Counter Plus does not continuously query tabs and then there is almost no performance hit to be avoided, but I can consider adding this option.

StoopidoMan commented 3 years ago

I think that would Great

ScienceDiscoverer commented 2 years ago

I have another suggestion concerning this. It would be nice to make some setting to hide the counter compleately while window has less than X amount of tabs, and then re-enable it when there is more than X tabs.

For now, I managed to implement this via userChrome.css to enable the counter only when tabs overflow, like this:

#tabbrowser-tabs:not([overflow]) ~ #tab-counter-plus_loirooriol-browser-action {
    display: none !important;
}

#tabbrowser-tabs[overflow] ~ #tab-counter-plus_loirooriol-browser-action {
    display: -moz-box !important;
}

I placed my counter on the title-bar, instead of address bar, too. I also removed right spacer via CSS, so now tab counter acts as a useful spacer when tabs overflow!

But having build-in, customisable solution for specific number of tabs would be nice too!

Loirooriol commented 2 years ago

There is no API to completely hide a browser action. I can disable it, or show a plain image instead of a counter, but not hide it.

Hiding page actions was possible but I think they changed it, since in V3 there is just "action".

Gitoffthelawn commented 2 years ago

BTW, you can inject some CSS to hide the counter except on hover. I do this to keep the UI clean but powerful.

Loirooriol commented 2 years ago

Users can do that with userChrome.css. My add-on can't do it because WebExtensions are heavily restricted.

Gitoffthelawn commented 2 years ago

Right, sorry, I should have mentioned users performing the injection via userChrome.css.