-
Notifications
You must be signed in to change notification settings - Fork 51
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
[Feature]: Auto Dark Mode for Web Contents #4656
Comments
You can activate the experimental dark mode(s) available here : edge://flags/#enable-force-dark |
How can I enable it in WebView2? |
Goto the address : edge://flags/#enable-force-dark |
You should also be able to set browser flags programmatically through https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/webview-features-flags?tabs=winrtcsharp#setting-browser-flags-programmatically-through-code |
My feedback is about WebView2, not Edge |
Auto Dark Mode for Web content is not in the flag support list described at https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/webview-features-flags?tabs=winrtcsharp#setting-browser-flags-programmatically-through-code |
Doesn't it relies on webpage having proper support being made to enable dark themes? |
No, this is a fallback for web pages that don't support dark mode. That's why it used to be called forced dark mode. In theory, it follows this order |
Describe the feature/enhancement you need
Automatically render all web contents using a dark theme
In the Android, this function has been integrated into the Android Webview
https://stackoverflow.com/questions/62548348/how-to-force-dark-web-pages-in-android-webview
The following shows the approximate effect of smart forced dark mode in Edge and Chrome browsers
![image](https://private-user-images.githubusercontent.com/6630660/344564080-8003a280-bce8-495e-9418-1ba0f5a62741.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNzgzMTgsIm5iZiI6MTcyMDA3ODAxOCwicGF0aCI6Ii82NjMwNjYwLzM0NDU2NDA4MC04MDAzYTI4MC1iY2U4LTQ5NWUtOTQxOC0xYmEwZjVhNjI3NDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0Wk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aWQ9MCZyZXBvX2lkPTAifQ.XqIhl74GUSriC6M_YIUIFsrPsbJahzfRMiRSDWmrZS4)
The scenario/use case where you would use this feature
We often need to introduce dark mode web pages in the dark mode interface to achieve a consistent appearance. If the web page colors can be automatically inverted, it will greatly reduce the development cost of the web page - otherwise we will have to prepare two sets of color schemes for the web page.
Now, these operations sometimes rely on browser plug-ins, but if only individual web pages need to be accessed, introducing plug-ins for them is too bloated.
Edge includes this feature, namely
Auto Dark Mode for Web Contents
How important is this request to you?
Critical. My app's basic functions wouldn't work without it.
Suggested implementation
Enable this API in Webview
What does your app do? Is there a pending deadline for this request?
No response
The text was updated successfully, but these errors were encountered: