-
Notifications
You must be signed in to change notification settings - Fork 4
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
Corss-origin stylesheets without crossorigin="anonymous" attribute not supported (e.g. Hardware.info) #31
Comments
Thanks for the report. FYI: Please mind to fill out the issue template you choose – completly, when you open an issue the next time. This makes it easier to troubleshoot issues or so. |
The CSS on that site is hosted on Technical details:
In the case of this website, there is no "crossorigin" attribute on that Possible workarounds I see:
P.S. If someone wants to play with number 2, use my "Custom CORS Control" extension with the rule: |
Hi, uhm I remembered having written sth. here already, but apparently it got lost. So if anyone is wondering, if I get it correctly, we are talking about this issue/part in the code: website-dark-mode-switcher/src/content_scripts/applyColorSchemeCss.js Lines 118 to 126 in 7c31112
Now thanks @tartpvule for your investigation into the issue and finding out what we have done. 2 and 3. are really quite invasive for the website and also require a lot of development to intercept all requsts. (also, it could have negative performance effects.) Following the links there this solution looks like the privileged fetch approach. And this here is the bug report in the Mozilla issue tracker (feel free to upvote it). |
After investigating this further... The missing piece is actually Constructable Stylesheets, which, according to this page, is behind If you're being risky, you can actually create a This is number 3 with "the CSS parser" being the browser itself. Of course, this has some gotchas, for example:
Note that, if we care about security, we cannot mutate the DOM tree in anyway, including injecting our stylesheets as Not to mention, if/when Firefox introduces the ability for extensions to directly control prefers-color-scheme, all these work will not be needed (and thus be thrown out). This is very difficult to get right IMHO. I don't think I'm going to try implementing this any time soon. |
I totally agree, it's likely not worth implementing this right now.
So yeah, when Firefox adds this, maybe then there is a better time to look at it. Thus, marking it as blocked now. |
Hi, I have great news for you! According to my testing, the latest v2.0 release fixes this issue due to the way it now uses a completely new API to do "dark-mode-changing" "properly". For more information, please see the release notes. If the issue should not be fixed, please let me know. |
Affected website:
https://nl.hardware.info/
Bug description
Will not go into dark mode site provides on firefox. When Win10 OS is set to dark and you open this site in edge f.e. it will show their developed dark mode (bleuish in this case). Can it be also made to work with this extension on Firefox?
The text was updated successfully, but these errors were encountered: