Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Windows High Contrast Theme
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Windows High Contrast Theme
When you set High Contrast Theme in Windows, by default looks like CEF will also put dark theme on all web pages you visit, all of them shows with black background, with no additional setting on GlobalCefApp.
Is there a way to change this behaviour ? I want CEF to show pages like default, even when in High Contrast Theme in Windows.
Thanks
Is there a way to change this behaviour ? I want CEF to show pages like default, even when in High Contrast Theme in Windows.
Thanks
Re: Windows High Contrast Theme
do you manage to include a light theme on the official chrome with a contrasting one on Windows?
If so, how?
switching the "chrome://flags/#enable-force-dark" add-in doesn't help.
If so, how?
switching the "chrome://flags/#enable-force-dark" add-in doesn't help.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Windows High Contrast Theme
There seems to be a lot of people asking for the same thing in the Chrome forums:thefunkyjoint wrote: Wed Mar 30, 2022 12:50 pm When you set High Contrast Theme in Windows, by default looks like CEF will also put dark theme on all web pages you visit, all of them shows with black background, with no additional setting on GlobalCefApp.
Is there a way to change this behaviour ? I want CEF to show pages like default, even when in High Contrast Theme in Windows.
Thanks
https://support.google.com/chrome/thread/32479550/cannot-disable-dark-mode?hl=en
https://support.google.com/chrome/thread/34740241/chrome-stuck-in-dark-mode?hl=en
https://support.google.com/chrome/thread/4877043/why-can-t-i-disable-dark-mode-on-chrome-without-disabling-it-for-windows-too?hl=en
Some people fix this by disabling the "Auto dark mode" flag which we can do with this code line :
Code: Select all
GlobalCEFApp.DisableBlinkFeatures := 'AutoDarkMode';
https://windowsreport.com/dark-mode-chrome-turn-off/
Even with all these fixes some websites like youtube keep the dark mode. Perhaps you need to log in and disable it in their settings too.
Re: Windows High Contrast Theme
Maybe I don't understand something, but these settings don't work for me.



-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Windows High Contrast Theme
salvadordf wrote: Thu Mar 31, 2022 10:08 amThis command won't work for me :thefunkyjoint wrote: Wed Mar 30, 2022 12:50 pm Some people fix this by disabling the "Auto dark mode" flag which we can do with this code line :For some other sites like google.com we can turn the dark mode using their settings button :Code: Select all
GlobalCEFApp.DisableBlinkFeatures := 'AutoDarkMode';
https://windowsreport.com/dark-mode-chrome-turn-off/
Even with all these fixes some websites like youtube keep the dark mode. Perhaps you need to log in and disable it in their settings too.
GlobalCEFApp.DisableBlinkFeatures := 'AutoDarkMode';
Even with this, CEF4Delphi will show a black background when using Windows High Contrast Theme. You can test this in web version of Whatsapp. The problem is, with this dark mode enabled, the QR Code used to connect won't work so the only workaround is to disable Windows High Contrast Theme.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Windows High Contrast Theme
If you use this line to force the dark mode then remove it :
Code: Select all
GlobalCEFApp.BlinkSettings := 'forceDarkModeEnabled';
Re: Windows High Contrast Theme
Apparently there is only one way out, it's in the Windows theme settings to change the black background to white))
Which of course will affect all applications.
Which of course will affect all applications.

-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Windows High Contrast Theme
Looks like so. Let's wait for next versions.dilfich wrote: Fri Apr 01, 2022 5:18 pm Apparently there is only one way out, it's in the Windows theme settings to change the black background to white))
Which of course will affect all applications.![]()
Re: Windows High Contrast Theme
Hi,
In the meantime, is there a solution to forcefully disable dark mode?
Thank you
In the meantime, is there a solution to forcefully disable dark mode?
Thank you
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Windows High Contrast Theme
Hi,
Add this before the GlobalCEFApp.StartMainProcess call :
GlobalCEFApp.UIColorMode works reliably but I had inconsistent results with WebContentsForceDark.
Perhaps you'll need to clear the cache or run the browser in "Chrome runtime" mode.
Add this before the GlobalCEFApp.StartMainProcess call :
Code: Select all
GlobalCEFApp.DisableFeatures := 'WebContentsForceDark';
GlobalCEFApp.UIColorMode := uicmForceLight;
Perhaps you'll need to clear the cache or run the browser in "Chrome runtime" mode.