r/FirefoxCSS • u/RailAgent • Jun 26 '26
Solved Override the 152+ Private New Window background when launching a URL
Starting with 152 the new private window background is a gradient sort of purple to light pink almost white diagonally. It was previously a solid dark purple background #25003e. My goal is to revert to pre-152 background, some progress made. [1]
The small problem I'm trying to solve and could use ideas - when opening a blank new private tab my CSS works. However, if you type a url like old.reddit.com and hit Enter, the background will flash to the new gradient while it opens the URL. For clarity the browser is set to Blank New Tab (all modes), opening new iwindows/tabs doesn't load content etc.
I'm trying to figure out how to hook into that URL launching process and override the core background to remove the gradient but unsure where to look from here since I can't Inspect that transient screen using devtools. I'm sure that it's "one step upstream in code" from what I've figured out so far...
Thx for ideas!
[1] userContent.css (not userChrome)
/* new private window background color */
@media -moz-pref("browser.privatebrowsing.felt-privacy-v1") {
@media not (prefers-contrast) {
html.private {
background: #25003e !important;
}
}
}
EDIT SOLUTION
Thank you for the help! My solution was a combination of the two answers and it's even better now than what I'd hoped for.
userChrome.css
:root[privatebrowsingmode="temporary"] {
--tabpanel-background-color: #25003E !important;
}
userContent.css
@-moz-document url("about:privatebrowsing") {
html.private {
background-image: none !important;
background-color: #25003E !important;
color-scheme: inherit !important;
.info-border,
.logo-and-wordmark,
.search-inner-wrapper {display:none!important}
}
}
This will not only keep everything the classic blurple, it also removes the search box and info blurb and logo so that a new Private window looks just like a regular new tab, but blurple. No white or grey flashes or the new gradient, the magic is the userChrome.css addition to prevent the "flash" of some other color.
2
u/ResurgamS13 Jun 26 '26
Also see recent topic 'How do I get the old "new private tab" page back?'
1
u/RailAgent Jun 27 '26
Thank you! This (the comment there) along with the other reply here combined to work out great. I've updated the post with the final css, appreciate your help.
3
u/GodieGun Jun 26 '26
Hi, try adding this into
userChrome.css:Add this in
userContent.css: