put_DefaultBackgroundColor not working when WebView2 is in DarkMode
What happened?
I put WebView2 into DarkMode by those two settings:
- pEnvironmentOptions->put_AdditionalBrowserArguments("--enable-features=WebContentsForceDark:inversion_method/cielab_based/image_behavior/none");
- pProfile->put_PreferredColorScheme(COREWEBVIEW2_PREFERRED_COLOR_SCHEME_DARK);
When I then want to set the DefaultBackgroundColor via pController3->put_DefaultBackgroundColor(col); // col is COREWEBVIEW2_COLOR the background color does not change.
When WebView2 is in LightMode, put_DefaultBackgroundColor() works as expected.
Importance
Moderate. My app's user experience is affected, but still usable.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
121.0.2277.128
SDK Version
1.0.2088.41
Framework
Win32
Operating System
Windows 10
OS Version
19045.3930
Repro steps
Just initialize WebView2 in DarkMode and then call put_DefaultBackgroundColor()
Repros in Edge Browser
Yes, issue can be reproduced in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
Hi @MarkusSchreiner this is a known issue and we have it on our backlog. Thank you for reporting this, it helps to know that users are actively running into this.
The same problem, more than half a year has passed, and it has not been fixed
It seems to me that the recent release is supposed to address this, and yet no official comments of advice?
Hi @MarkusSchreiner, @simear2004 & @ajtruckle. The issue is resolved now.
You can refer the doc here.
Hi all. I just saw that last entry, and tried to use ICoreWebView2Controller3 for setting the back color.
But, when Edge's Dark-Mode is activated (like in my initial post), the backgorung color still does not change!
Please re-open the issue!