MrOtherGuy / firefox-csshacks

Collection of userstyles affecting the browser
Mozilla Public License 2.0
3.13k stars 310 forks source link

chrome/hide_tabs_with_one_tab.css might need an update #300

Closed hansemn closed 1 year ago

hansemn commented 1 year ago

I could be mistaken, but I tried using some of this CSS code in Fx 115.1esr (Mac), and it didn't work.

The part in question is line 55.

After some digging through searchfox, I changed it to:

#tabbrowser-tabs:not([overflow="true"]) ~ #alltabs-button { display: none !important; }

_So overflowing to overflow, which worked.

MrOtherGuy commented 1 year ago

Using #tabbrowser-tabs:not([overflowing="true"]) ~ #alltabs-button is essentially the same as #alltabs-button because #tabbrowser-tabs never has overflowing="true" attribute. And we definitely don't want to always hide alltabs-button.

It might need to have that !important tag though, however as far as can tell the style seems to work correctly on Windows as is. I can't find any OS specific behavior for this, but maybe there is some other configuration option which is required to trigger bad behavior here. One thing that comes to mind would be if you somehow end up in a situation where #tabbrowser-tabs always has overflow="true" attribute set - even when it is not actually overflowing. I can't remember what exactly but I remember seeing some custom styles that do cause such scenario to happen.

hansemn commented 1 year ago

Thanks for the reply, I will dig a bit deeper into it.

I just can't find that overflowing attribute for tabs on searchfox, only this one, or this.

MrOtherGuy commented 1 year ago

You can't find it because such doesn't exist. But the way you wrote it uses negation: #tabbrowser-tabs:not([overflowing="true"]) and as such this would mean that "match tabbrowser-tabs only when it does not have 'overflowing' attribute". Because it never has that, your clause effecticely means "match tabbrowset-tabs always".

hansemn commented 1 year ago

Aaah, I think I got it now; thanks for the explanation, and sorry about the bother.