Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 2.18 KB

webview_unsupportedurischemeidentified.md

File metadata and controls

49 lines (34 loc) · 2.18 KB
-api-id -api-type
E:Windows.UI.Xaml.Controls.WebView.UnsupportedUriSchemeIdentified
winrt event

Windows.UI.Xaml.Controls.WebView.UnsupportedUriSchemeIdentified

-description

Occurs when an attempt is made to navigate to a Uniform Resource Identifier (URI) using a scheme that WebView doesn't support.

-xaml-syntax

<WebView UnsupportedUriSchemeIdentified="eventhandler"/>

-remarks

See WebViewUnsupportedUriSchemeIdentifiedEventArgs.

WebView supports navigation to Uniform Resource Identifier (URI) using these schemes: http, https, ms-appx-web, ms-appdata and ms-local-stream.

If an attempt is made to navigate to a Uniform Resource Identifier (URI) that the WebView doesn't support, the navigation is blocked. By default, when an unsupported Uniform Resource Identifier (URI) scheme is encountered, the launcher is invoked to find the default provider for the Uniform Resource Identifier (URI) scheme. You can handle the UnsupportedUriSchemeIdentified event to decide how to handle an unsupported Uniform Resource Identifier (URI) scheme. If you do nothing, the launcher is invoked. If you provide custom handling for the Uniform Resource Identifier (URI) scheme, set the Handled property to true to prevent the default provider for the Uniform Resource Identifier (URI) scheme from being invoked.

-examples

<WebView x:Name="myWebView" UnsupportedUriSchemeIdentified="OnUnsupportedUriSchemeIdentified" /> 
private void OnUnsupportedUriSchemeIdentified (WebView sender, WebViewUnsupportedUriSchemeIdentifiedEventArgs e) 
{ 
    // Block all URIs from invoking other apps except the mailto: protocol. 
    if (e.Uri.Scheme != "mailto") 
    { 
        e.Handled= true; 
    } 
} 

-see-also

WebViewUnsupportedUriSchemeIdentifiedEventArgs