ICoreWebView2.add_WebResourceRequested

Add an event handler for the WebResourceRequested event. WebResourceRequested runs when the WebView is performing a URL request to a matching URL and resource context filter that was added with AddWebResourceRequestedFilter. At least one filter must be added for the event to run.

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 add_NewWindowRequested handler it should be called after the new window is set. For more details see ICoreWebView2NewWindowRequestedEventArgs::put_NewWindow.

This event is by default raised for file, http, and https URI schemes. This is also raised for registered custom URI schemes. For more details see ICoreWebView2CustomSchemeRegistration.

\snippet SettingsComponent.cpp WebResourceRequested0 \snippet SettingsComponent.cpp WebResourceRequested1

interface ICoreWebView2
HRESULT
add_WebResourceRequested

Meta