提交 b670c0db 编写于 作者: M Martin Zikmund

chore: Adjust Android web message handler name

上级 181eac80
......@@ -31,8 +31,6 @@ internal class NativeWebViewWrapper : INativeWebView
//
// this will still be used to handle extra activity with the native control.
_webView.SetWebViewClient(new InternalClient(_coreWebView, this));
_webView.SetWebChromeClient(new InternalWebChromeClient());
_webView.Settings.JavaScriptEnabled = true;
_webView.Settings.DomStorageEnabled = true;
_webView.Settings.BuiltInZoomControls = true;
......@@ -40,7 +38,10 @@ internal class NativeWebViewWrapper : INativeWebView
_webView.Settings.SetSupportZoom(true);
_webView.Settings.LoadWithOverviewMode = true;
_webView.Settings.UseWideViewPort = true;
_webView.AddJavascriptInterface(new UnoWebMessageHandler(this), "unoWebMessageHandler");
_webView.SetWebViewClient(new InternalClient(_coreWebView, this));
_webView.SetWebChromeClient(new InternalWebChromeClient());
_webView.AddJavascriptInterface(new UnoWebViewHandler(this), "unoWebView");
//Allow ThirdPartyCookies by default only on Android 5.0 and UP
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
......
......@@ -3,11 +3,11 @@ using Java.Interop;
namespace Uno.UI.Xaml.Controls;
internal class UnoWebMessageHandler : Java.Lang.Object
internal class UnoWebViewHandler : Java.Lang.Object
{
private readonly NativeWebViewWrapper _nativeWebView;
public UnoWebMessageHandler(NativeWebViewWrapper wrapper)
public UnoWebViewHandler(NativeWebViewWrapper wrapper)
{
_nativeWebView = wrapper;
}
......
......@@ -42,7 +42,7 @@ public partial class WebView : Control, IWebView
protected override void OnApplyTemplate() => CoreWebView2.OnOwnerApplyTemplate();
public void Navigate(global::System.Uri uri) => CoreWebView2.Navigate(uri.ToString());
public void Navigate(global::System.Uri source) => CoreWebView2.Navigate(source.ToString());
public void NavigateToString(string text) => CoreWebView2.NavigateToString(text);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册