次の方法で共有


CoreWebView2.WebResourceRequested Event

Definition

WebResourceRequested is raised when the WebView is performing a URL request to a matching URL and resource context filter that was added with AddWebResourceRequestedFilter(String, CoreWebView2WebResourceContext, CoreWebView2WebResourceRequestSourceKinds).

public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2WebResourceRequestedEventArgs> WebResourceRequested;
member this.WebResourceRequested : EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2WebResourceRequestedEventArgs> 
Public Custom Event WebResourceRequested As EventHandler(Of CoreWebView2WebResourceRequestedEventArgs) 

Event Type

Remarks

At least one filter must be added for the event to be raised. The web resource requested may be blocked until the event handler returns if a deferral is not taken on the event args. If a deferral is taken, then the web resource requested is blocked until the deferral is completed.

If this event is subscribed in the NewWindowRequested handler it should be called after the new window is set. For more details see NewWindow.

This event is by default raised for file, http, and https URI schemes. This is also raised for registered custome URI schemes. See CoreWebView2CustomSchemeRegistration for more details.

Applies to

See also