Comments (8)
Indeed I have the same hope and once https://bugzilla.mozilla.org/show_bug.cgi?id=1547818 is solved this add-on can be trivially adjusted to always work and we would not have to care about these strange bugs.
(Note for now you can also use an about:config entry to toggle that. Just FYI.)
from website-dark-mode-switcher.
Looks like this in v ccb9911 in my testing:
Is not this what you expect?
from website-dark-mode-switcher.
Ah okay, so you expect no background in small windows there?
Well… yeah… I see the problem and your provided solution would be the only one I can imagine.
Feel free to submit a PR.
from website-dark-mode-switcher.
Though I have to say injecting the whole CSS again could also break things, e.g.:
- if there are other CSS files that take precedence that do not contain any
prefers-color-scheme
. They would not be recognized. - If CSS styles are dynamically adjusted by JS, the add-on could overwrite these accidentally with it's own injected styles from the website's stylesheets.
- possibly more 🤔
So maybe that's not a good idea. 🤔
from website-dark-mode-switcher.
if there are other CSS files that take precedence that do not contain any
prefers-color-scheme
. They would not be recognized.
I though about replace the prefer-color-scheme: dark media query with the own content.
When the User switch back to Light theme, We can replace to orginal (in variable / cache) file
If CSS styles are dynamically adjusted by JS, the add-on could overwrite these accidentally with it's own injected styles from the website's stylesheets.
Javascript Changes should add a "style" attribute. And style Attributes are always prioritized. (Expect !important)
possibly more 🤔
Jeah possible
Another Solution (don't know if is possible):
Learn the Browser the media Query (if not already known) and set the prefer-color-scheme
before parsing the CSS Files. Then the extraction could be removed
from website-dark-mode-switcher.
Your alternative solution is not possible, but the replacement basically is already done.Just not the whole file. Well… as said, you could hack around, try it out and send a PR if it works. 😃
See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/insertCSS on how it basically works/for the API you need to use.
from website-dark-mode-switcher.
I'm sorry, I don't have enough time to test/check this problem. For me it works on a real-life device (Chrome Mobile on Android 8). So when firefox (with your Plugin) has Problems, I don't really matter :). (sorry).
I hope that Mozilla will at a native Button / Option for that and don't need another Plugin to activate Dark Mode.
from website-dark-mode-switcher.
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.
from website-dark-mode-switcher.
Related Issues (20)
- Doesn't work with stylesheets imported with @import HOT 2
- Simplify dramatically now that mediaText is read-write HOT 4
- Automatic theme change not working in Open Fixture Library HOT 2
- Corss-origin stylesheets without crossorigin="anonymous" attribute not supported (e.g. Hardware.info) HOT 6
- Inconsistent Application on New Tabs HOT 12
- Support forcing light mode HOT 2
- Project is not needed anymore - What are the next steps? HOT 5
- https://ar.al/ Vimeo Embed Inverted HOT 2
- Bootstrap 5 Dark Mode has incorrect gradient/fades applied HOT 1
- implement optional syncing! HOT 1
- Adjust permissions doc
- Implement context menu for quickly switching to other styles
- Implement "clever"/context-based/"simple" button mode HOT 1
- Updated translations for 'da': Danish (dansk) HOT 1
- force dark theme through resistFingerprinting HOT 3
- Missing renaming
- Solution for Dark Mode Website Switcher not working with arkenfox's user.js HOT 2
- Show a warning in case privacy.resistFingerprinting is enabled
- Cannot download from Firefox Addon Store HOT 1
- Support setting light/dark mode on a per site/URL basis. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from website-dark-mode-switcher.