How can I injecting javascript from webview2 in WPF

2022-11-22T10:51:09.177+00:00

I am using gecko browser earlier. now moving to web view2. In the code when using gecko they we getting the data from the javascript and storing the data. Example given below

using (var java = new AutoJSContext(webBrowser.Window.))
{
var result = java.EvaluateScript("get_players()", webBrowser.Window.DomWindow);
MessageBox.Show(result.ToString());
}

so is there a way how web view2 works.

Developer technologies Windows Presentation Foundation
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.