Click or drag to resize

IResourceRequestHandler Interface

Version 75.1.140
Implement this interface to handle events related to browser requests. The methods of this class will be called on the CEF IO thread unless otherwise indicated.

Namespace:  CefSharp
Assembly:  CefSharp (in CefSharp.dll) Version: 75.1.140.0 (75.1.140.0)
Syntax
public interface IResourceRequestHandler

The IResourceRequestHandler type exposes the following members.

Methods
  NameDescription
Public methodGetCookieAccessFilter
Called on the CEF IO thread before a resource request is loaded. .
Public methodGetResourceHandler
Called on the CEF IO thread before a resource is loaded. To specify a handler for the resource return a IResourceHandler object
Public methodGetResourceResponseFilter
Called on the CEF IO thread to optionally filter resource response content.
Public methodOnBeforeResourceLoad
Called on the CEF IO thread before a resource request is loaded. To redirect or change the resource load optionally modify request. Modification of the request URL will be treated as a redirect
Public methodOnProtocolExecution
Called on the CEF UI thread to handle requests for URLs with an unknown protocol component. SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION.
Public methodOnResourceLoadComplete
Called on the CEF IO thread when a resource load has completed. This method will be called for all requests, including requests that are aborted due to CEF shutdown or destruction of the associated browser. In cases where the associated browser is destroyed this callback may arrive after the OnBeforeClose(IWebBrowser, IBrowser) callback for that browser. The IsValid method can be used to test for this situation, and care should be taken not to call browser or frame methods that modify state (like LoadURL, SendProcessMessage, etc.) if the frame is invalid.
Public methodOnResourceRedirect
Called on the CEF IO thread when a resource load is redirected. The request parameter will contain the old URL and other request-related information. The response parameter will contain the response that resulted in the redirect. The newUrl parameter will contain the new URL and can be changed if desired.
Public methodOnResourceResponse
Called on the CEF IO thread when a resource response is received. To allow the resource load to proceed without modification return false. To redirect or retry the resource load optionally modify request and return true. Modification of the request URL will be treated as a redirect. Requests handled using the default network loader cannot be redirected in this callback. WARNING: Redirecting using this method is deprecated. Use OnBeforeResourceLoad or GetResourceHandler to perform redirects.
Top
See Also