Example #1
0
        void NavigationFailed(WWebView sender, Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs e)
        {
            Uri uri = sender.Source;

            if (uri != null)
            {
                SendNavigated(new UrlWebViewSource {
                    Url = uri.AbsoluteUri
                }, _eventState, WebNavigationResult.Failure);
            }
        }
Example #2
0
 void OnNavigationCompleted(WWebView sender, Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs e)
 {
     if (e.IsSuccess)
     {
         NavigationSucceeded(sender, e);
     }
     else
     {
         NavigationFailed(sender, e);
     }
 }
Example #3
0
        async void NavigationSucceeded(WWebView sender, Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs e)
        {
            // TODO WINUI3
            //if (e.Uri != null)
            //	SendNavigated(new UrlWebViewSource { Url = e.Uri.AbsoluteUri }, _eventState, WebNavigationResult.Success);
            Uri uri = sender.Source;

            if (uri != null)
            {
                SendNavigated(new UrlWebViewSource {
                    Url = uri.AbsoluteUri
                }, _eventState, WebNavigationResult.Success);
            }

            UpdateCanGoBackForward();

            if (Element.OnThisPlatform().IsJavaScriptAlertEnabled())
            {
                await Control.ExecuteScriptAsync("window.alert = function(message){ window.external.notify(message); };");
            }
        }