Open LazuliKao opened 9 months ago
NavigationStarting
NavigationCompleted
Clients\AvaloniaWebViewClient.cs
Clients\Blazor\AvaloniaBlazorWebViewClient.cs
AvaloniaWebViewClient
IWebViewControl.ExecuteScriptAsync
TaskCompletionSource
var cts = new TaskCompletionSource<string?>(); _webView.EvaluateJavascript( javaScript, new JavaScriptValueCallback(result => cts.TrySetResult(result?.ToString())) ); return cts.Task;
NavigationStarting
andNavigationCompleted
events on the Avalonia.WebView.Android (non-Blazor mode).NavigationStarting
和NavigationCompleted
事件的bugClients\AvaloniaWebViewClient.cs
移到Clients\Blazor\AvaloniaBlazorWebViewClient.cs
,实现AvaloniaWebViewClient
用于非Blazor模式的WebViewClient,相应对应事件IWebViewControl.ExecuteScriptAsync
用TaskCompletionSource
转成普通异步。