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

[Bug] Opening popup triggers extension mode flip #1810

Open
Tech-How opened this issue Aug 19, 2024 · 1 comment
Open

[Bug] Opening popup triggers extension mode flip #1810

Tech-How opened this issue Aug 19, 2024 · 1 comment

Comments

@Tech-How
Copy link

Bug Report

Bug Description

If you have themes installed that are set to only activate when the Stylus extension is in dark mode, and the Stylus extension is currently in light mode, opening the extension pop-up on an affected webpage will cause all dark-mode-only styles to become active. This probably works the other way around as well.

System Information

  • OS: Windows
  • Browser: Firefox 129.0.1
  • Stylus Version: 1.5.48

Additional Context

To reproduce this, do the following:

  • In Firefox Settings (about:preferences#general), set the browser theme to Automatic, and make sure the Firefox theme is set to "System theme" under (about:addons). Additionally, set the Windows app theme to dark.
  • Set the Stylus extension theme settings to "By system preference"
  • Open a style in the editor, and under "Style settings" in the left pane, select dark. This should configure that style to only activate when the system is in dark mode.
  • Visit the website the style is installed for. The style should be active.
  • Go to (about:preferences#general) in Firefox, and change the browser theme from Automatic to Light.
  • Return to the website. The style should no longer be active.
  • Open the stylus pop-up from the browser toolbar. The style activates again, even though the system is still in light mode.

Not all of these steps may be necessary, but I wanted to provide as much detail as possible.

@tophf
Copy link
Member

tophf commented Aug 19, 2024

It's a bug in Firefox's implementation of this global theme option that apparently affects matchMedia API in extensions. Not sure how we can circumvent it.

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

No branches or pull requests

2 participants