Enable dark mode on chrome's internal pages

85,569

Solution 1

On my system, I have the dark mode active:

Dark mode in Chrome 75

I need to do two things:

  • launch the browser using google-chrome-stable --enable-features=WebUIDarkMode --force-dark-mode and
  • set the browser to use the Classic option rather than GTK+ as shown in the image below. Doing so makes the choice your GTK theme irrelevant:

Use Classic, not GTK+ in chrome://settings/?search=themes

Use Classic, not GTK+


Unfortunately, not all internal pages are themed. Opening many of the urls in chrome://chrome-urls/ will confirm that. It's not clear if or when they'll ever get round to that!

Solution 2

Note: as of chrome Version 78.0.3904.87 (Official Build) (64-bit) you can easliy turn chrome's internal pages to dark mode,its under chrome flags by default

  • run chrome://flags in the url
  • search for dark and you should see this option Force Dark Mode for Web Contents just enable it and relaunch chrome.

this is how it looks enter image description here

for those who don't have the above option under flags To enable dark mode on Ubuntu, you need to edit the google-chrome.desktop file.

If you use GNOME desktop, simply run the command below which opens up the required file in editable format. If not, open the file in a text editor of your choice

sudo -H gedit /usr/share/applications/google-chrome.desktop

All you have to do is search for two lines and add a dark mode flag in front of them.

  1. Search for

    Exec=/usr/bin/google-chrome-stable %U
    

    and replace it with:

    Exec=/usr/bin/google-chrome-stable %U --force-dark-mode
    
  2. Search for

    Exec=/usr/bin/google-chrome-stable
    

    and add the dark mode flag after it like this:

    Exec=/usr/bin/google-chrome-stable --force-dark-mode
    

Once you have done these changes, simply try restarting chrome. If that doesn't work, rebooting your Ubuntu system should do the job.

For me rebooting my Ubuntu 18.04 system worked. Also note that if you update the chrome app, the changes will be gone, since the file will be overwritten.

Solution 3

Just paste

chrome://flags 

in the search bar, and in the opened page, search for 'dark' and find

Force Dark Mode for Web Contents

Enable this thing, and you're done.
Now you've got the dark mode.

Solution 4

I made a script for it, just run:

bash -c "$(curl -fsSL "https://raw.githubusercontent.com/felipecassiors/dotfiles/master/scripts/enable_chrome_dark_mode.sh")"

Output:

We will:
  - Create the file '/home/felipesantos/.local/share/applications/google-chrome.desktop'

Do you confirm? (Yy)y

All done.
Please make sure you fully close Google Chrome before opening a new instance.

To uninstall, run:
  $ rm -f /home/felipesantos/.local/share/applications/google-chrome.desktop

It currently uses the method described by DK Bose's answer, but I might change in the future if it stops working. Basically, it:

  1. Copies Chrome's system shortcut to the user shortcut
  2. Edits the options on the executable for you

There is no need to change Chrome's theme in my tests tough.

Solution 5

I would highly recommend installing Dark Reader which intelligently scans the CSS of the page to keep background dark and adjust foreground colors accordingly. Here is a snippet showing dark reader in action

Original Original

Dark reader Dark Reader modified

Share:
85,569

Related videos on Youtube

lamino
Author by

lamino

Updated on September 18, 2022

Comments

  • lamino
    lamino over 1 year

    I have dark mode working on chrome's internal pages in Windows 10. Is it not implemented in the Ubuntu version?

    I'm using chrome version 75.0. My theme is Adwaita-dark.

  • lamino
    lamino almost 5 years
    Finally.. Thanks!
  • Remco Haszing
    Remco Haszing over 4 years
    Instead of modifying /usr/share/applications/google-chrome.desktop, the file can be copied into ~/.local/share/applications/google-chrome.desktop and modified without root access. This file will take precedence over the global desktop file.
  • Jeanba
    Jeanba about 4 years
    Why downvoting this post? Is there something against Dark reader chrome extension?
  • NeuroXc
    NeuroXc over 3 years
    This is not the system dark mode, this only emulates dark mode by inverting colors of web pages. It can break readability of some websites.
  • Iluvathar
    Iluvathar over 3 years
    @Jeanba for one, extensions can't modify internal and protected pages, so Chromium settings pages will remain light.
  • Iluvathar
    Iluvathar over 3 years
    That's simple ugly inversion, not real dark mode.
  • Timo
    Timo over 3 years
    Works on Lubuntu 20_04. The font is now different than before and less readable. But I am happy because I heard that this mode is fair better for my eyes.
  • ManuelSchneid3r
    ManuelSchneid3r over 3 years
    Can I change this at runtime?
  • soroosh
    soroosh about 3 years
    This solution also works for chromium-browser.
  • somebody
    somebody about 3 years
    note also that while this "intelligently scans pages", it's not intelligent to detect when a page is already dark, making the majority of dark themes provided by the sites themselves useless
  • Siddhesh Rane
    Siddhesh Rane about 3 years
    @somebody not true. You might have had issue with one or two sites. But the vast majority of sites that provide dark themes are rendered fine. It keeps them dark and legible. Thats what matters.
  • somebody
    somebody about 3 years
    @SiddheshRane that's not what matters to me, what matters is that it doesn't ruin the carefully crafted themes of sites already on dark theme, which is literally trivial to do
  • hashlash
    hashlash over 2 years
    I use GTK+ and it still works (using --enable-features=WebUIDarkMode --force-dark-mode flags)
  • Admin
    Admin almost 2 years
    Thanks, it works very well!