31

Is there a built-in way in Firefox to blacken or to colour the about:blank page?

Will I maybe save some energy by doing so?

28

Yes you can change the color. As explained here you should

  1. Windows: go to %appdata%/mozilla/firefox/profiles and open the folder in there.

    On Linux the equivalent is ~/.mozilla/firefox/RANDOM_TEXT.default/

    On OSX it is /Library/Application Support/Firefox/Profiles/RANDOM_TEXT.default

  2. look for the chrome folder. In that folder, find userContent-example.css and rename it to userContent.css.

    The folder and file may not be there yet with newer Firefox versions. If so, simply create them manually.

  3. Add this line to the file

    @-moz-document url-prefix(about:blank) {*{background-color:#000000;}}
    

As to whether it will save energy, probably not:

On LCD displays, color may confer no benefit at all. In response to my inquiry, Steve Ryan, program manager for Energy Star’s power-management program, asked consulting firm Cadmus Group to run a quick test by loading Blackle, Google and the Web site of the New York Times (which is, like Google, mostly white on-screen) on two monitors — one CRT, one LCD — and connecting a power meter to both. “We found that the color on screen mattered very little to the energy color consumption of the LCD monitor,” said David Korn, principal at Cadmus, which specializes in energy and environment, and does work for the government. The changes were so slight as to be within the margin of error for the power meter. Tweaking brightness and contrast and settings had a bigger effect. The bulkier CRT screen did see savings with Blackle of between 5% and 20%. Mr. Korn emphasized that this was a quick test, not a rigorous study.

  • Woohoo :D It worked! Thank you very much! On my Mac it was /Library/Application Support/Firefox/Profiles/123xyz.default. I had to manually create the chrome folder and placed your CSS file in there, restart and it worked! Thanks! – leymannx Jun 3 '13 at 17:35
  • 4
    The disadvantage of setting the background-colour is, that especially on websites with text entry fields the background of the text will also appear in that background-colour... In other words: websites where no CSS background colour is set, the background colour is the Firefox background-colour. Makes typing/reading quite uncomfortable. So I set it back to default by deleting the userContent.css – leymannx Jul 3 '13 at 9:20
  • 3
    Easier way to open profile folder: open "about:support" page in Firefox and click the "Profile Folder" button. – ciastek Jan 3 '17 at 0:00
  • 3
    It works for Firefox 57 also, just chreate the chrome/userConent.css file if it doesn't exist. – tigerjack89 Nov 30 '17 at 20:45
  • 1
    As far as I know, this trick no longer works on Firefox 67. – Pygasm Jun 5 at 20:43
30

Under about:config, change browser.display.background_color from #ffffff to whatever hex value you want.

Changing screen space to a dark color (preferably black) will ONLY make a power difference when using AMOLED screens, most commonly found on phones. So if you're using a regular LCD, TFT or, IPS display, you won't see any battery life improvements, but your browser will be swagged out

  • 1
    This worked best for me. – Adam Crane Nov 4 '18 at 22:31
  • 1
    This should be the accepted answer. – Nick Painter Jul 2 at 19:48
  • This must be the accepted answer since it does not require you to edit Firefox related files and is simpler. – Eray Erdin Sep 10 at 15:08
  • Did not work for me on Firefox 69 on Ubuntu Linux 18.04. Furthermore, as explained on kb.mozillazine.org/About:config_entries#Browser this setting can actually be changed in the regular user preference panel. – Stéphane Gourichon Oct 8 at 12:09
  • To be more precise, this settings applies either "only to pages that don't specify a color" or "on all pages only when using a high contrast theme" or "on all pages". We don't want it "on all pages", only on new blank tab. – Stéphane Gourichon Oct 9 at 6:51
14

If you have Stylus extension installed, just create a new style with this exact code:

@-moz-document url-prefix(about:blank) {*{background-color:#000000;}}

credit goes to terdon's answer


Update: Apparently, what Stylus says in its message about how this no longer works on special pages like about:blank, it actually still totally does! To add a script, you have to use the workaround proposed by mic in comments:

  • Open the Manage page of Stylus with the list of all scripts you have;
  • Press "Write new style" button;
  • Under the large "Mozilla format" header press the "Import" button, and a popup with a textbox will open, paste the entire script from this post into it, and press "overwrite style"
  • Don't forget to add a descriptive name for the script in the top left textbox;
  • Press "Save".
  • 3
    +1 This should be up voted more. In v38 of Firefox it should be about:newtab – L84 May 4 '15 at 17:32
  • That is if you wish for your new tab to be about:newtab. I set it to about:blank myself. – user1306322 May 4 '15 at 18:41
  • True but my about:blank page and new tab are one and the same for me, at least with the way I use FF. => – L84 May 4 '15 at 20:37
  • I added both about:newtab and about:blank to have all of my tab start with black background: @-moz-document url-prefix(about:newtab) {*{background-color:#000000;}} @-moz-document url-prefix(about:blank) {*{background-color:#000000;}} – Kamran Bigdely May 13 '16 at 3:16
  • 1
    You can still use Stylus and write a style for about:blank and the style will work, despite the message from Stylus. You just have to go to Manage > Write > Import > [Paste in the code] Overwrite style, and name your style and save. (Firefox 68) – mic Jul 26 at 11:38
5

I know this is an old question, but in Firefox 64, the chrome folder doesn't exist anymore in the /Library/Application Support/Firefox/Profiles/RANDOM_TEXT.default location.

I did find a setting though under the about:config key browser.display.background_color, which you can set to any hex color code. This setting will probably save my eyes a couple dozen times a day.

HTH

  • Works great - thanks! Takes effect at the moment the about:config tab is closed. – jcoppens Jun 11 at 5:30
  • You can just create the chrome folder and the userChrome.css file. – Casey Jones Jun 29 at 3:11
  • chrome.css is apparently going to be disabled by default in the near future, but you can re-enable it via about:config settings bugzilla.mozilla.org/show_bug.cgi?id=1541233 – user1306322 Aug 24 at 18:48
  • 1
    This isn't working for me on FF 68.0.2 (64-bit, Ubuntu 16.04). – TenLeftFingers Aug 24 at 21:09
  • background_color is the settings mentioned in @fredthefaillord and doesn't work on recent firefox. – Stéphane Gourichon Oct 9 at 6:53
1

Set browser.display.use_system_colors to true in about:config.

  • Did not work for me on Firefox 69 on Ubuntu Linux 18.04. – Stéphane Gourichon Oct 9 at 6:54
  • Your system theme should be dark of course. – sergio Oct 10 at 10:24
  • Before writing here, I tried dark system theme with default firefox theme which follows it, then with firefox dark theme, did not work either. Thanks for mentioning this anyway. – Stéphane Gourichon Oct 10 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.