How to make the about:blank page black or any other color in Firefox?

35

17

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?

leymannx

Posted 2013-06-03T17:19:33.657

Reputation: 526

1

Similar/Related: Change the white background in webpages to another color

– Ƭᴇcʜιᴇ007 – 2013-06-03T17:29:27.863

Answers

33

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.

terdon

Posted 2013-06-03T17:19:33.657

Reputation: 45 216

3Easier way to open profile folder: open "about:support" page in Firefox and click the "Profile Folder" button. – ciastek – 2017-01-03T00:00:04.670

3It works for Firefox 57 also, just chreate the chrome/userConent.css file if it doesn't exist. – tigerjack89 – 2017-11-30T20:45:29.150

Yo terdon, can you confirm and maybe incorporate the newest answer below? – leymannx – 2019-01-31T09:10:17.420

1As far as I know, this trick no longer works on Firefox 67. – Mercury Platinum – 2019-06-05T20:43:37.673

For firefox version >= 67 use this answer

– kevinSpaceyIsKeyserSöze – 2019-10-05T13:02:05.460

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 – 2013-06-03T17:35:17.123

4The 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 – 2013-07-03T09:20:11.783

43

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

fredthefaillord

Posted 2013-06-03T17:19:33.657

Reputation: 441

2This worked best for me. – Adam Crane – 2018-11-04T22:31:25.893

3This should be the accepted answer. – Nick Painter – 2019-07-02T19:48:52.377

This must be the accepted answer since it does not require you to edit Firefox related files and is simpler. – Eray Erdin – 2019-09-10T15:08:02.517

Did not work for me on Firefox 69 on Ubuntu Linux 18.04. Furthermore, as explained on http://kb.mozillazine.org/About:config_entries#Browser this setting can actually be changed in the regular user preference panel.

– Stéphane Gourichon – 2019-10-08T12:09:14.603

6To 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 – 2019-10-09T06:51:36.283

1

This breaks the background color on pages like https://wolframalpha.com and many others, making them potentially unreadable. The accepted answer, or the one at https://gist.github.com/gmolveau/a802ded1320a7591a289fb7abd0d6c45, works correctly.

– erb – 2020-01-09T15:15:33.640

Although this will break the background for any web page without default background, when using plugins like DarkReader to make all pages dark, it can work out well. – Sushruth – 2020-01-30T08:10:33.263

15

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".

user1306322

Posted 2013-06-03T17:19:33.657

Reputation: 4 237

3+1 This should be up voted more. In v38 of Firefox it should be about:newtab – L84 – 2015-05-04T17:32:40.870

That is if you wish for your new tab to be about:newtab. I set it to about:blank myself. – user1306322 – 2015-05-04T18:41:32.350

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 – 2015-05-04T20:37:22.900

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 – 2016-05-13T03:16:26.767

Please note that "Stylish extension steals all your internet history" since it was bought by SimilarWeb.

– Luc – 2018-08-19T13:54:46.133

@Luc changed it to Stylus – user1306322 – 2018-08-20T10:30:18.650

@user1306322 Thanks! This might be the first time I see an unnamed account still be active after a few months, let alone five years :) – Luc – 2018-08-20T15:00:11.713

@Luc I'm an exception but normally you'd want to just suggest an edit with sufficient explanation or post your own answer. But only after a while, of course. Sometimes the poster notices and edits their answer as in this case :) – user1306322 – 2018-08-21T12:16:28.120

as to be noted that the newest ff does not allow this in stylus anymore – ProtoAES256 – 2018-10-08T09:19:09.617

No longer possible. If you attempt to use stylus to do this, Firefox will show the following message:

As a security precaution, the browser prohibits extensions from affecting its built-in pages (like chrome://version, the standard new tab page as of Chrome 61, about:addons, and so on) as well as other extensions' pages. Each browser also restricts access to its own extensions gallery (like Chrome Web Store or AMO). – Nick Painter – 2019-07-02T19:42:36.397

1You 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 – 2019-07-26T11:38:13.690

6

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

Stephanvs

Posted 2013-06-03T17:19:33.657

Reputation: 161

Works great - thanks! Takes effect at the moment the about:config tab is closed. – jcoppens – 2019-06-11T05:30:59.730

You can just create the chrome folder and the userChrome.css file. – Casey Jones – 2019-06-29T03:11:21.823

chrome.css is apparently going to be disabled by default in the near future, but you can re-enable it via about:config settings https://bugzilla.mozilla.org/show_bug.cgi?id=1541233

– user1306322 – 2019-08-24T18:48:12.527

1This isn't working for me on FF 68.0.2 (64-bit, Ubuntu 16.04). – TenLeftFingers – 2019-08-24T21:09:54.440

background_color is the settings mentioned in @fredthefaillord and doesn't work on recent firefox. – Stéphane Gourichon – 2019-10-09T06:53:52.870

It works for me on 69.0.2 under Ubuntu 18.04 – bartolo-otrit – 2019-10-25T08:57:28.820

1

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

sergio

Posted 2013-06-03T17:19:33.657

Reputation: 225

Did not work for me on Firefox 69 on Ubuntu Linux 18.04. – Stéphane Gourichon – 2019-10-09T06:54:36.727

Your system theme should be dark of course. – sergio – 2019-10-10T10:24:24.667

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 – 2019-10-10T14:00:42.877