Replies: 2 comments 1 reply
-
I came across the private async void button2_Click(object sender, EventArgs e)
{
await webView21.EnsureCoreWebView2Async();
webView21.CoreWebView2.ProcessFailed += CoreWebView2OnProcessFailed;
var helper = webView21.CoreWebView2.GetDevToolsProtocolHelper();
webView21.Source = new Uri("https://google.nl");
await helper.Page.EnableAsync();
helper.Page.LoadEventFired += PageOnLoadEventFired;
await helper.Overlay.EnableAsync(); // <===== Exception thrown here;
helper.Overlay.NodeHighlightRequested += OverlayOnNodeHighlightRequested;
} Enabling the overlay domain causes the following exception to be thrown:
Is it because the Overlay domain is still experimental? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I had the same problem and was down the same path you are. I looked at the nuget package you referenced, The code that is working for me now is: private async void button2_Click(object sender, EventArgs e)
{
var json = "{\"mode\":\"searchForNode\",\"highlightConfig\":{\"showInfo\":true,\"contentColor\":{\"r\": 155, \"g\": 11, \"b\": 239, \"a\": 0.7}}}";
await webView21.CoreWebView2.CallDevToolsProtocolMethodAsync("DOM.enable", "{}");
await webView21.CoreWebView2.CallDevToolsProtocolMethodAsync("Overlay.enable", "{}");
await webView21.CoreWebView2.CallDevToolsProtocolMethodAsync("Overlay.setInspectMode", json);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm implementing WebView2 1.0.2106-prerelease in a WinForms .NET 6 application.
I'm trying to subscribe to the
Overlay.nodeHighlightRequested
event, but I'm not receiving anything. I am getting thePage.loadEventFired
. In both cases the correct domain is enabled.Below the code used for initializing the WebView2:
Any thoughts on what I'm doing wrong?
Cheers,
Peter
Beta Was this translation helpful? Give feedback.
All reactions