public static void MapEval(WebViewHandler handler, IWebView webView, object?arg) { if (arg is not string script) { return; } handler.PlatformView?.Eval(webView, script); }
public static void MapEvaluateJavaScriptAsync(WebViewHandler handler, IWebView webView, object?arg) { if (arg is EvaluateJavaScriptAsyncRequest request) { if (handler.PlatformView == null) { request.SetCanceled(); return; } handler.PlatformView.EvaluateJavaScript(request); } }
public static async void MapReload(WebViewHandler handler, IWebView webView, object?arg) { try { var url = ((MauiWKWebView)handler.PlatformView).CurrentUrl; if (url != null) { await handler.SyncPlatformCookiesAsync(url); } } catch (Exception exc) { handler.MauiContext?.CreateLogger <WebViewHandler>()?.LogWarning(exc, "Syncing Existing Cookies Failed"); } handler.PlatformView?.UpdateReload(webView); }
public static void MapSource(WebViewHandler handler, IWebView webView) { IWebViewDelegate?webViewDelegate = handler.NativeView as IWebViewDelegate; handler.NativeView?.UpdateSource(webView, webViewDelegate); }
public static void MapReload(WebViewHandler handler, IWebView webView, object?arg) { handler.PlatformView?.UpdateReload(webView); }
public static void MapGoForward(WebViewHandler handler, IWebView webView, object?arg) { handler.PlatformView?.UpdateGoForward(webView); }