Skip to content

Instantly share code, notes, and snippets.

@SebastianGrans
Last active November 28, 2023 20:40
Show Gist options
  • Save SebastianGrans/cd8217fe7042a37a047300a0f09a1e1d to your computer and use it in GitHub Desktop.
Save SebastianGrans/cd8217fe7042a37a047300a0f09a1e1d to your computer and use it in GitHub Desktop.
Prevent Firefox from blinding you when opening new tabs

I use Darkreader to give any website a dark mode, which I highly recommend. Even with this plugin, there are breif moments when opening links, that the browser displays an entirely white screen. Thankfully, this can be mitigated!

  1. Enable toolkit.legacyUserProfileCustomizations.stylesheets in about:config
  2. Create a folder, /chrome/, in your Firefox profile folder
  • You can find the folder by going to about:support
  • On Windows: C:\Users\<user>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile>.default-release\chrome\userChrome.css
  1. Add the following .css files.
  2. Restart Firefox
  3. Test it out by going to about:blank

Note: You can edit the hex values to your liking. I used the background color of the new tab page.

userChrome.css

#browser vbox#appcontent tabbrowser, #content, #tabbrowser-tabpanels, browser[type=content-primary], browser[type=content] > html {
    background: #2b2a33 !important;
}

userContent.css

@-moz-document url(about:blank), url(about:newtab) {
    #newtab-window, html:not(#ublock0-epicker) {
        background: #2b2a33 !important;
    }
}

Sources:

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