WebView.UnsupportedUriSchemeIdentified Event

Definition

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

C#
public event TypedEventHandler<WebView,WebViewUnsupportedUriSchemeIdentifiedEventArgs> UnsupportedUriSchemeIdentified;
XAML
<WebView UnsupportedUriSchemeIdentified="eventhandler"/>

Event Type

Examples

XAML
<WebView x:Name="myWebView" UnsupportedUriSchemeIdentified="OnUnsupportedUriSchemeIdentified" /> 
C#
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; 
    } 
} 

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.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also