var response2 = webView21.CoreWebView2.ExecuteScriptAsync("function foo(){return 1;}; foo();").Result;
if (response2 != null) //it never reach here
{
//...
}
For the code above, it will not continue after the first line, so I can't get the result of the javascript.
But for these codes:
string response1 = await webView21.CoreWebView2.ExecuteScriptAsync(
"function foo(){return 1;}; foo();"
);
It return immediately with response1 = "1"
I am wondering why.