qutebrowser / qutebrowser

A keyboard-driven, vim-like browser based on Python and Qt.
https://www.qutebrowser.org/
GNU General Public License v3.0
9.45k stars 1.01k forks source link

`colors.webpage.preferred_color_scheme` ain't working #8187

Closed goyalyashpal closed 1 month ago

goyalyashpal commented 1 month ago
  • colors.webpage.prefers_color_scheme_dark which asks the page for a dark stylesheet, so the page will need to provide a dark CSS (requires QtWebEngine, Qt 5.14 and a restart after setting)

it ain't working. the documentation website (local) made using sphinx with shibuya theme (which does have 3 modes: system, force light, force dark) - stays in light mode despite changing the system theme and qute restart.

the system mode of website is working well in normal browsers.

i have removed the config.py before doing all these restarts etc, and here's the autoconfig.yaml:

(i am not setting the setting as it's (supposed to be) at auto by default, which means follow system which is what i need https://qutebrowser.org/doc/help/settings.html#colors.webpage.preferred_color_scheme)

$ ls "$APPDATA"/qutebrowser/config/
autoconfig.yml  bookmarks  greasemonkey  quickmarks

$ bat -pP "$APPDATA"/qutebrowser/config/autoconfig.yml
# If a config.py file exists, this file is ignored unless it's explicitly loaded
# via config.load_autoconfig(). For more information, see:
# https://github.com/qutebrowser/qutebrowser/blob/main/doc/help/configuring.asciidoc#loading-autoconfigyml
# DO NOT edit this file by hand, qutebrowser will overwrite it.
# Instead, create a config.py - see :help for details.

config_version: 2
settings:
  auto_save.session:
    global: true
  qt.highdpi:
    global: true
qutebrowser v3.1.0
Backend: QtWebEngine 6.6.1, based on Chromium 112.0.5615.213 (from api)
Qt: 6.6.1

CPython: 3.12.0
PyQt: 6.6.1

also, there's no qutebrowser.exe --version on cli?

Originally posted by @goyalyashpal in https://github.com/qutebrowser/qutebrowser/discussions/5733#discussioncomment-9128539

goyalyashpal commented 1 month ago
> qutebrowser --temp-basedir

it opens with duck duck go light theme - despite system being in dark mode

:set colors.webpage.preferred_color_scheme
" see it's set to auto

:set colors.webpage.preferred_color_scheme auto
:restart
" explicitly set it to auto, still no change

:set colors.webpage.preferred_color_scheme dark
:restart
" explicitly set to dark, webpage succesfully loads in a dark theeme

:qa
" quit all
The-Compiler commented 1 month ago

The auto setting is handled by the underlying QtWebEngine/Chromium, not qutebrowser itself.

I'm assuming you're on Windows from you mentioning qutebrowser.exe? It looks like this is already fixed in Qt 6.7 from a quick test - I can only reproduce with Qt 6.6. qutebrowser v3.2.0 with Qt 6.7 should be released once the issue in #8175 is fixed.