Skip to content

Commit

Permalink
Fix WebView (dotnet#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
myroot committed Aug 24, 2022
1 parent a65f342 commit 7ce11b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ protected override NWebView CreatePlatformView()
/// <inheritdoc />
protected override void ConnectHandler(NWebView platformView)
{
PlatformView.PageLoadFinished += OnLoadFinished;
PlatformView.Context.RegisterHttpRequestInterceptedCallback(OnRequestInterceptCallback);
PlatformView.AddJavaScriptMessageHandler("BlazorHandler", PostMessageFromJS);
platformView.PageLoadFinished += OnLoadFinished;
platformView.Context.RegisterHttpRequestInterceptedCallback(OnRequestInterceptCallback);
platformView.AddJavaScriptMessageHandler("BlazorHandler", PostMessageFromJS);
}

/// <inheritdoc />
protected override void DisconnectHandler(NWebView platformView)
{
PlatformView.PageLoadFinished -= OnLoadFinished;
platformView.PageLoadFinished -= OnLoadFinished;
base.DisconnectHandler(platformView);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Core/src/Platform/Tizen/MauiWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public MauiWebView()

void IWebViewDelegate.LoadHtml(string? html, string? baseUrl)
{
if (baseUrl == null)
if (baseUrl != null)
{
LoadContents(html, (uint)(html?.Length ?? 0), null, null, baseUrl);
LoadContents(html, (uint)(html?.Length ?? 0), "text/html", "UTF-8", baseUrl);
}
else
{
Expand Down

0 comments on commit 7ce11b1

Please sign in to comment.