Пример #1
0
 private void FacebookWebViewUnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     if (args.Uri.Scheme.ToLower() == "fbconnect")
     {
         args.Handled = true;
     }
 }
Пример #2
0
 private void WebViewControl_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     // handle custome scheme in the redirect uri, such as: ms-app://{store id}
     AuthorizeRedirectChanged?.Invoke(sender, args.Uri.OriginalString);
     args.Handled = true;
     Hide();
 }
Пример #3
0
        private void WebViewUnsupportedUriSchemeIdentified(WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
        {
            var uri = args.Uri;

            args.Handled = true;

            Logger.Debug($"UnsupportedUriScheme: {uri.AbsolutePath}");
        }
Пример #4
0
 private void UnsupportedUriSchemeIdentifiedEventHandler(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     // This event is called when a link like mailto:// is called.
     args.Handled = true;
     if (TryExtractOriginalUrl(args, out string url))
     {
         OnNavigating(url);
     }
 }
Пример #5
0
        private async void View_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
        {
            if (string.Equals(args.Uri.Scheme, "tg", StringComparison.OrdinalIgnoreCase))
            {
                args.Handled = true;

                await ProcessQueryAsync(args.Uri);
            }
        }
Пример #6
0
        // 在尝试导航至 WebView 不支持的协议的 uri 时触发的事件
        private async void WebView2_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
        {
            // 交由我处理吧(否则的话系统会弹出对话框,以便跳转至支持此协议的其他 app 或者在商店搜索支持此协议的 app)
            args.Handled = true;

            // 尝试导航至的 uri
            Uri myUri = args.Uri;

            await new MessageDialog(myUri.ToString(), "自定义 uri").ShowAsync();
        }
Пример #7
0
        private void ChallengePanel_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
        {
            string url = args.Uri.ToString();

            if (url.StartsWith("unity:"))
            {
                string token = url.Substring("unity:".Length);
                Verify(token);
                args.Handled = true;
            }
        }
Пример #8
0
        private async void web_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
        {
            if (args.Uri.AbsoluteUri.Contains("bilibili://"))
            {
                args.Handled = true;

                var re = await MessageCenter.HandelUrl(args.Uri.AbsoluteUri);

                if (!re)
                {
                    Utils.ShowMessageToast("不支持打开的链接" + args.Uri.AbsoluteUri);
                }
            }
        }
Пример #9
0
 private static bool TryExtractOriginalUrl(WebViewUnsupportedUriSchemeIdentifiedEventArgs args, out string url)
 {
     try
     {
         if (args?.Uri != null)
         {
             url = args.Uri.OriginalString;
             return(true);
         }
     }
     catch
     {
         // It is possible that even calling the getter "args.Uri" already results in an
         // exception, e.g. when the event was triggered with a "tel://*" protocol.
     }
     url = null;
     return(false);
 }
Пример #10
0
        private void WebView_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args) {

            if (args.Uri.Scheme.Equals("wheelmap")) {
                args.Handled = true;

                User user = new User();
                user.email = null;
                user.apiKey = null;
                user.privacyAccepted = false;
                user.termsAccepted = false;
                
                var paramList = args.Uri.ToString().Split('?').Last().Split('&');
                foreach(string p in paramList) {
                    var keyVal = p.Split('=');
                    if (keyVal.Length > 1) {
                        var key = keyVal[0];
                        var value = keyVal[1];
                        switch (key) {
                            case "token":
                                user.apiKey = value;
                                break;
                            case "email":
                                user.email = value;
                                break;
                            case "privacy_accepted":
                                user.privacyAccepted = Convert.ToBoolean(value);
                                break;
                            case "terms_accepted":
                                user.termsAccepted = Convert.ToBoolean(value);
                                break;
                        }
                    }
                }

                User.CurrentUser = user;
                
            }


            Log.d(args.Uri);
        }
Пример #11
0
        /// <summary>
        /// Event that captures when the webview navigates to unsupported uri schemes.
        /// In this case, this would intercept redirects to the "urn:ietf:wg:oauth:2.0:oob" mobile app URI.
        /// </summary>
        private void webView_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
        {
            string uri = args.Uri.ToString();

            if (uri.StartsWith("urn"))
            {
                // Response is in the query string.
                //
                txtResponse.Text = uri;

                // Close the webview
                //
                webView.Visibility = Visibility.Collapsed;

                // This will prevent the webview from trying to actually load the page,
                // which will result in windows asking what program to open "urn" with
                //
                args.Handled = true;

                _redirectUri = null;
            }
        }
Пример #12
0
 private void ChallengeV2kWebViewUnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     //if (args.Uri.Scheme.ToLower() == "fbconnect")
     //    args.Handled = true;
 }
Пример #13
0
 public void webView_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     /*WebViewPage.InfoDialog.IsOpen = true;
      * WebViewPage.InfoDialog.Title = "Unsupported uri scheme detected";
      * WebViewPage.InfoDialog.IsLightDismissEnabled = false;*/
 }
Пример #14
0
 private void WebView_UnsupportedUriSchemeIdentified(WebView sender,
     WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     Debug.WriteLine("Unsupported Uri Clicked");
 }
 Uri IWebViewUnsupportedUriSchemeIdentifiedEventArgsResolver.Uri(WebViewUnsupportedUriSchemeIdentifiedEventArgs e) => e.Uri;
 void IWebViewUnsupportedUriSchemeIdentifiedEventArgsResolver.Handled(WebViewUnsupportedUriSchemeIdentifiedEventArgs e, bool handled) => e.Handled = handled;
Пример #17
0
 private void WebView_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     args.Handled = true;
     sender.Navigate(new Uri("ms-appdata:///local/webui/index.html" + args.Uri.Fragment));
 }
 /// <summary>
 /// Gets the Uniform Resource Identifier (URI) of the content the <see cref="WebView"/> attempted to navigate to.
 /// </summary>
 /// <param name="e">The requested <see cref="WebViewUnsupportedUriSchemeIdentifiedEventArgs"/>.</param>
 /// <returns>The URI of the content.</returns>
 public static Uri Uri(this WebViewUnsupportedUriSchemeIdentifiedEventArgs e) => Resolver.Uri(e);
 /// <summary>
 /// Sets a value that marks the routed event as handled.
 /// A <c>true</c> value prevents most handlers along the event
 /// route from handling the same event again.
 /// </summary>
 /// <param name="e">The requested <see cref="WebViewUnsupportedUriSchemeIdentifiedEventArgs"/>.</param>
 /// <param name="handled">
 /// <c>true</c> to mark the routed event handled.
 /// <c>false</c> to leave the routed event unhandled, which permits the event to potentially
 /// route further and be acted on by other handlers.
 /// </param>
 public static void Handled(this WebViewUnsupportedUriSchemeIdentifiedEventArgs e, bool handled) => Resolver.Handled(e, handled);
Пример #20
0
 private void MainWebView_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     args.Handled = true;
 }
Пример #21
0
 private void Webview_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
     // Should be handled here.
     args.Handled = true;
 }
 bool IWebViewUnsupportedUriSchemeIdentifiedEventArgsResolver.Handled(WebViewUnsupportedUriSchemeIdentifiedEventArgs e) => e.Handled;
 /// <summary>
 /// Gets a value that marks the routed event as handled.
 /// A <c>true</c> value prevents most handlers along the event
 /// route from handling the same event again.
 /// </summary>
 /// <param name="e">The requested <see cref="WebViewUnsupportedUriSchemeIdentifiedEventArgs"/>.</param>
 /// <returns>
 /// <c>true</c> to mark the routed event handled.
 /// <c>false</c> to leave the routed event unhandled, which permits the event to potentially
 /// route further and be acted on by other handlers.
 /// </returns>
 public static bool Handled(this WebViewUnsupportedUriSchemeIdentifiedEventArgs e) => Resolver.Handled(e);
Пример #24
0
 private void web_UnsupportedUriSchemeIdentified(WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs args)
 {
 }