Skip to content

OnWebResourceRequested - cWebView2Browser

Triggered when the page loads a resource that matches a filter that is configures using AddWebResourceRequestedFilter

Type: Event

Parameters

Parameter Type Description
sUrl String The requested URL
sMethod String TTP Method for the request ("GET", "POST", ..).
eContext OLECOREWEBVIEW2_WEB_RESOURCE_CONTEXT Indicates the context for the request (OLECOREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST for AJAX Calls, OLECOREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE for images, ..).

Syntax

Procedure OnWebResourceRequested String sUrl String sMethod OLECOREWEBVIEW2_WEB_RESOURCE_CONTEXT eContext

Description

Event that triggers when the page loads a resource that matches a filter that is configures using AddWebResourceRequestedFilter. This can be used for logging purposes, but the response can also be overridden.

During this event, the WebResourceRequestHeader and WebResourceRequestContent messages can be used to query details from the request. The WebResourceResponseSet and WebResourceResponseSetHeader messages can be used to override the response.