Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'prefers-color-scheme: dark' doesn't work in vomnibar #4148

Closed
0xhtml opened this issue Oct 20, 2022 · 9 comments
Closed

'prefers-color-scheme: dark' doesn't work in vomnibar #4148

0xhtml opened this issue Oct 20, 2022 · 9 comments

Comments

@0xhtml
Copy link

0xhtml commented Oct 20, 2022

Since the latest Firefox update on Arch Linux the Vomnibar is no longer in dark mode. Firefox version: 106.0 64bit. The options page and all other websites are still respecting dark mode and it is even possible to force the prefers-color-scheme for the vomnibar through the developer tools.

To Reproduce
I freshly reset Firefox 106.0 (no bookmarks, no settings, no add-ons, nothing).
Then set Firefox theme to the default dark theme and selected dark as the default appearance of websites in the firefox settings.
Websites are now in dark mode.
Then installed vimium and pressed o (or O, b etc.) to open the vomnibar and it is light themed.
20221020_21h10m03s_grim

I can however use the developer tools to enable the dark theme for the vomnibar.
20221020_21h10m24s_grim

It seems to me like this issue was introduced by the Firefox update and not an update to vimium. It might be a bug in Firefox.

Browser and Vimium version

Firefox:
Version 106.0
Build-ID 20221017100737
Distributions-ID archlinux

Vimium-Version: 1.67.2

@gdh1995
Copy link
Contributor

gdh1995 commented Oct 21, 2022

Firefox 106 has changed how it deals with color-scheme: light on <iframe>, and then the solution in #3848 fails.

According to my tests, on Firefox 106 and Win11, this works if in content_scripts/vimium.css:

.vimiumUIComponentVisible {
  color-scheme: normal;
}

But on Chrome 102/106 and Win11, normal doesn't work while light succeeds.

Updated (2022/10/29): I tested Chrome 88/102/106 on Win11 again, and found normal works. But changes on color-scheme CSS property may not take effect, unless Vomnibar is hidden and shown again.

gdh1995 added a commit to gdh1995/vimium-c that referenced this issue Oct 21, 2022
@nikinbaidar
Copy link

I've the same problem. The Vomnibar takes up light theme after the Firefox update. Trying

.vimiumUIComponentVisible {
  color-scheme: normal;
}

or

.vimiumUIComponentVisible {
  color-scheme: dark;
}

does not seem to work on Arch Linux.

@nikinbaidar
Copy link

I'd also like to add that the help dialog which was previously dark has now changed to a light theme too.

@DEAN-Cherry
Copy link

Firefox 106 has changed how it deals with color-scheme: light on <iframe>, and then the solution in #3848 fails.

According to my tests, on Firefox 106 and Win11, this works if in content_scripts/vimium.css:

.vimiumUIComponentVisible {
  color-scheme: normal;
}

But on Chrome 102/106 and Win11, normal doesn't work while light succeeds.

So what can we do to solve this issue? This file seems to be unchangeable.

@gdh1995
Copy link
Contributor

gdh1995 commented Oct 29, 2022

@nikinbaidar How did you test it?

  • CSS for Vimium UI won't work, because Vomnibar is inside a Shadow DOM tree, and the CSS won't be injected into it.
  • If you downloaded Vimium source code and loaded it as a temporary extension, then you may need to reload the extension and your test page, so that Vimium can load latest file changes.
  • I justed tested Firefox 106.0.2 on Ubuntu 18, and color-scheme: normal worked.
  • dark of course fails - it should not be used in such a situation.

@DEAN-Cherry Um yes Firefox's extension files are always packaged into a single file. So:

  1. you may load Vimium source code as a temporary extension on about:debugging#/runtime/this-firefox, and apply the changes
    1. in this way, please note that Firefox clears "temporary extensions" on closing, so you have to keep your Firefox open
    1. or you have to load the customized version of Vimium everytime Firefox starts
  1. or just wait a further version of Vimium to fix it.

@philc
Copy link
Owner

philc commented Oct 29, 2022

Thanks for investigating the solution @gdh1995. Tricky.

gdh1995 added a commit to gdh1995/vimium-c that referenced this issue Oct 29, 2022
@nikinbaidar
Copy link

nikinbaidar commented Oct 30, 2022

The update to 106.0.2 fixed the original issue but now when I open GitHub there's a dark background behind the vomnibar and

.vimiumUIComponentVisible {
  color-scheme: normal;
}

doesn't seem to fix it.

Edit: It seems this has already been updated in the master in /content_scripts/vimium.css. However changing normal to light doesn't work either.

@gdh1995
Copy link
Contributor

gdh1995 commented Oct 31, 2022

Reproduced on https://github.com/settings/appearance + GitHub light/dark theme + Firefox 106.0.3 in Light/Dark theme + dark theme enabled in DevTools and also reported in #4156 .

gdh1995 added a commit to gdh1995/vimium-c that referenced this issue Nov 1, 2022
See philc/vimium#4159 .

`color-scheme: light dark;` works perfectly on Firefox 105/106 and Chrome 88/99/106 during my testes.

1. The changes which breaks `color-scheme: light`, as reported in philc/vimium#4148,
  is caused by a fix of https://bugzilla.mozilla.org/show_bug.cgi?id=1782596 .
2. And then I searched and found
  [1789338 - Element picker is light themed when uBlock origin theme is set to auto in Nightly](https://bugzilla.mozilla.org/show_bug.cgi?id=1789338)
3. So I installed uBlock Origin and tested its picker iframe, and noticed `color-scheme: light dark` (gorhill/uBlock#3872)
@gearonix
Copy link

Still issue with dark reader extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants