SUMMARY There are some websites, like https://duckduckgo.com, which are able to detect whether the user is using dark theme or not in the system and set themselves to light or dark mode automatically. Even if I have a dark Plasma's global theme, Falkon doesn't let those websites know it. STEPS TO REPRODUCE 1. Set Plasma's global theme to a dark theme. 2. Go to https://duckduckgo.com 3. It can't know that you are using dark theme. OBSERVED RESULT Exporting "QTWEBENGINE_CHROMIUM_FLAGS=--force-dark-mode" manually allows the supported websites to use dark mode. EXPECTED RESULT This should be applied automatically, if a dark theme is being used, without the need of user exporting the variable manually. If Plasma Settings' "Colors" has a light theme selected, dark mode in websites should be denied, and if it has a dark theme selected, dark mode should be allowed. SOFTWARE/OS VERSIONS Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.22.3 KDE Frameworks Version: 5.84.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION Firefox is able to detect the system's GNOME/GTK theme and allow the websites to set themselves accordingly to dark or light mode. The same kind of result is expected in Falkon.
Created attachment 146694 [details] left: falkon, right: firefox
I see several websites using CSS Media Feature "prefers-color-scheme" like apps.kde.org. But it doesn't work properly.
And falkon:start homepage also needs to support system themes (especially dark theme).
This should definitely be an option. Do note that the existing Falkon setting "Force dark mode", listed under Preferences > Browsing, is not the same. This setting, when enabled, will even try to apply custom dark modes to websites that don't have one, which can yield... Problematic results, and is a bit of a brute-force approach when more elegant solutions exist (as mentioned by the OP). Other browsers already do this - Firefox, Chrome, etc. - so I think it's safe to say users expect this.
A possibly relevant merge request was started @ https://invent.kde.org/network/falkon/-/merge_requests/103
Git commit 4a8236a3ee67a9a88dc8e95baef93eb959df4df5 by Juraj Oravec. Committed on 20/12/2024 at 22:16. Pushed by jurajo into branch 'master'. Add "Preffer color scheme" option Related: bug 497331 Signed-off-by: Juraj Oravec <jurajoravec@mailo.com> M +37 -13 src/lib/app/mainapplication.cpp M +2 -0 src/lib/app/mainapplication.h M +6 -0 src/lib/app/qzcommon.h M +15 -0 src/lib/preferences/preferences.cpp M +28 -1 src/lib/preferences/preferences.ui https://invent.kde.org/network/falkon/-/commit/4a8236a3ee67a9a88dc8e95baef93eb959df4df5