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

[Problem/Bug]: Calling devtools protocol method "Emulation.setDefaultBackgroundColorOverride" throws exception. #4116

Closed
WarWithinMe opened this issue Oct 31, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@WarWithinMe
Copy link

What happened?

Try to call devtools protocol Emulation.setDefaultBackgroundColorOverride, but failed with the following exception:

System.ArgumentException: Value does not fall within the expected range.
   at Microsoft.Web.WebView2.Core.Raw.ICoreWebView2.CallDevToolsProtocolMethod(String methodName, String parametersAsJson, ICoreWebView2CallDevToolsProtocolMethodCompletedHandler handler)
   at Microsoft.Web.WebView2.Core.CoreWebView2.CallDevToolsProtocolMethodAsync(String methodName, String parametersAsJson)

The code:

var param = "{\"color\": { r: 0, g: 0, b: 0, a: 0 }}";
await CoreWebView2.CallDevToolsProtocolMethodAsync("Emulation.setDefaultBackgroundColorOverride", param);

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Prerelease (Edge Canary/Dev/Beta)

Runtime Version

118.0.2088.76

SDK Version

1.0.2164-prerelease

Framework

Win32

Operating System

Windows 11

OS Version

No response

Repro steps

  1. Create a sample project.
  2. In project, create and display a CoreWebView2.
  3. Call the devtools protocol as following:
var param = "{\"color\": { r: 0, g: 0, b: 0, a: 0 }}";
await CoreWebView2.CallDevToolsProtocolMethodAsync("Emulation.setDefaultBackgroundColorOverride", param);

Regression

No, this never worked

Last working version (if regression)

No response

@WarWithinMe WarWithinMe added the bug Something isn't working label Oct 31, 2023
@monica-ch
Copy link
Contributor

monica-ch commented Nov 1, 2023

@WarWithinMe Let me know if below code works.


var param =  "{\"color\": {\"r\": 0, \"g\": 0, \"b\": 0, \"a\": 0}}";
await CoreWebView2.CallDevToolsProtocolMethodAsync("Emulation.setDefaultBackgroundColorOverride", param);

@WarWithinMe
Copy link
Author

@WarWithinMe Let me know if below code works.


var param =  "{\"color\": {\"r\": 0, \"g\": 0, \"b\": 0, \"a\": 0}}";
await CoreWebView2.CallDevToolsProtocolMethodAsync("Emulation.setDefaultBackgroundColorOverride", param);

It works, thanks for your solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants