Skip to content

Instantly share code, notes, and snippets.

@gmolveau
Last active June 26, 2025 20:32
Show Gist options
  • Save gmolveau/a802ded1320a7591a289fb7abd0d6c45 to your computer and use it in GitHub Desktop.
Save gmolveau/a802ded1320a7591a289fb7abd0d6c45 to your computer and use it in GitHub Desktop.
Firefox dark background / theme for new tab and loading screen

Firefox Dark Background

  • How to change the background on Firefox to a dark one on new tab / loading screen ?

Procedure

  • Type about:config in the URL bar
  • Search toolkit.legacyUserProfileCustomizations.stylesheets and double-click the field to set it to true
  • Type about:support in the URL bar
  • Look for Profile folder field and click on the open button next to it.
  • Create a folder with the name chrome
  • Inside this folder, create a file userChrome.css and paste the following code inside it :
tabbrowser tabpanels { background-color: rgb(19,19,20) !important; }
browser { background-color: #131314 !important; }
  • Then create another file userContent.css and paste the followind code in it :
@-moz-document url-prefix(about:blank) {
    html > body:empty {
        background-color: rgb(19,19,20) !important;
    }
}
@-moz-document url(about:blank) {
    html > body:empty {
        background-color: rgb(19,19,20) !important;
    }
}
  • Completely quit and restart firefox

  • Enjoy

@PaperNick
Copy link

Thanks bro! I have a script which automatically sets my OS theme to dark when sunset occurs, so I wrapped the CSS from your gist into a media query prefers-color-scheme to detect the OS theme change:

userChrome.css file

@media (prefers-color-scheme: dark) {
  tabbrowser tabpanels {
    background-color: rgb(19,19,20) !important;
  }

  browser {
    background-color: #131314 !important;
  }
}

userContent.css file

@media (prefers-color-scheme: dark) {
  @-moz-document url-prefix(about:blank) {
    html > body:empty {
      background-color: rgb(19,19,20) !important;
    }
  }

  @-moz-document url(about:blank) {
    html > body:empty {
      background-color: rgb(19,19,20) !important;
    }
  }
}

@Electrozombi
Copy link

tried and instantly worked on firefox 134! Thanks a lot!

@cyberslot
Copy link

cyberslot commented Apr 1, 2025

It doesn't work on Zen though (1.10.3b (Firefox 136.0.4) (aarch64))...

@Fan4eGGG
Copy link

doesnt work for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment