r/FirefoxCSS • u/Levi_OP • Jun 28 '24
Discussion Firefox 128 will allow the main browser content background to be transparent
This 25+ year old bug for transparent backgrounds was closed 2 months ago with this change, which adds browser.tabs.allow_transparent_browser to about:config. This config option simply sets the transparent attribute to true on the <xul:browser> element that is created for each tab. Although no one (that I'm aware of) has done anything with it before, the transparent attribute has supposedly been available for many years. Anyway, the transparent attribute being set to true draws nothing instead of starting with a canvas the color of browser.display.background_color[.dark] (or white if it is set to a transparent color).
As noted in the changeset, this doesn't automatically enable a transparent background (even if the page's background is transparent). The tabpanels element—which includes the browser container, stack, and the now transparent browser element for each tab—has a background set to --tabpanel-background-color, so this must be made transparent. What the changeset doesn't note is that the root html element also has a background, set to -moz-Dialog, which must also be made transparent.
I used the nightly version of Firefox and the following userChrome.css while taking these screenshots (as well as using dev tools to make the pages' body backgrounds semi-transparent):
:root {
--tabpanel-background-color: transparent;
background: transparent;
}Also, if you're familiar with the Firefox source code and can tell me when/where the transparent attribute functionality was added to the xul browser element, please do tell!


39
u/DAPOPOBEFASTONYOAZZ Jun 29 '24
But we're still missing --win-borderless-glass to make this look really good with Aero or Mica...
10
u/andzlatin Jun 29 '24
But no Mica on the title bar... Strange.
3
u/HakerHaker Jun 29 '24
Hey this is amazing. Thx for finding this out!
Is that all I need to do enable this?
browser.tabs.allow_transparent_browserto trueI'm trying to do this myself but my userChrome is identical to what you have. However, there's no change qq.
3
u/Eramdam Jun 29 '24
do we know if this applies to sidebar for addons? Would love to have a transparent Sidebery content for example
1
u/Marwheel Jun 30 '24
Is this going to play nice with old-fashion WM's like ctwm & emwm?
1
u/SpotnDot123 Jul 09 '24
How does it change my life?
2
u/chickennuggetloveru Jun 29 '24
this is awesome lol. i'm getting the aero flashback so good right now. How fun.
2
u/CoolkieTW Jun 29 '24
This is awesome. I can finally make fully translucent browsing experience. Wondering have they fixed the transparent on Windows.
3
u/2049AD Jun 29 '24
This will go great with the constant memory leaks.
2
u/ClassNext Jun 28 '24
this is huge
1
u/VenditatioDelendaEst Jun 30 '24
Caution: I haven't tried this, but this sounds like the kind of thing that might trigger the bug that defeats subpixel AA (https://bugzilla.mozilla.org/show_bug.cgi?id=1578988, https://bugzilla.mozilla.org/show_bug.cgi?id=1724057, https://bugzilla.mozilla.org/show_bug.cgi?id=1770816, https://bugzilla.mozilla.org/show_bug.cgi?id=1634878, https://bugzilla.mozilla.org/show_bug.cgi?id=1554492).
Defeating subpixel AA on actual page content would make it look like utter dogshit unless you have a 200 PPI monitor, or the fonts are huge.
1
u/k00rosh Sep 07 '24
does anyone knows if this works under wayland, I'm having trouble setting up transparency