General Computing
chromium flag dark-mode
Updated Mon, 27 Jun 2022 02:25:53 GMT

Dark mode in chrome-based browsers


I'd like to run chrome-based browser with a dark-mode on.

I can do it by

  1. going to: chrome://flags
  2. finding #enable-force-dark flag
  3. setting it "Enabled"

It works on my Linux system both on Chromium and Vivaldi, but it's a cumbersome approach when you need to toggle between dark/light mode everyday.

So is there any easier/faster way of setting specific flag? The best option would be to create a shortcut button for this action, but is it possible and how to do it?

As a substitute I wanted to run a browser from a command line with a specific flag set to "enabled" but it doesn't work. I found here that there is a "force-dark-mode" flag and according to this page, I tried to run

chromium --force-dark-mode 

and

chromium --force-dark-mode=enabled

In chromium it has no effect on the content of the page, it just changes the colour of the window frame. In vivaldi it has no effect at all. I also tried

chromium --enable-force-dark

Again, it has no effect at all neither in Chromium nor in Vivaldi. What's wrong with my approach?




Solution

OK. Finally, I found the answer that works for me. Here it is said that the correct command that allows running browser with dark mode on is:

chromium --enable-features=WebContentsForceDark

I still don't know how to toggle it with the use of a button.

EDIT: I've just found that source code for dark reader extension for chrome is published on github. I compiled the source code locally and got it working. This clears up all my doubts and fears concerning the privacy and security of the chromium extensions.