cef_request_handler_t

Implement this structure to handle events related to browser requests. The functions of this structure will be called on the thread indicated.

version(cef && embedded_cef_bindings)
extern (C)
struct cef_request_handler_t {}

Members

Variables

base
cef_base_ref_counted_t base;

Base structure.

get_auth_credentials
int function(cef_request_handler_t* self, cef_browser_t* browser, const(cef_string_t)* origin_url, int isProxy, const(cef_string_t)* host, int port, const(cef_string_t)* realm, const(cef_string_t)* scheme, cef_auth_callback_t* callback) nothrow get_auth_credentials;

Called on the IO thread when the browser needs credentials from the user. |origin_url| is the origin making this authentication request. |isProxy| indicates whether the host is a proxy server. |host| contains the hostname and |port| contains the port number. |realm| is the realm of the challenge and may be NULL. |scheme| is the authentication scheme used, such as "basic" or "digest", and will be NULL if the source of the request is an FTP server. Return true (1) to continue the request and call

get_resource_request_handler
cef_resource_request_handler_t* function(cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request, int is_navigation, int is_download, const(cef_string_t)* request_initiator, int* disable_default_handling) nothrow get_resource_request_handler;

Called on the browser process IO thread before a resource request is initiated. The |browser| and |frame| values represent the source of the request. |request| represents the request contents and cannot be modified in this callback. |is_navigation| will be true (1) if the resource request is a navigation. |is_download| will be true (1) if the resource request is a download. |request_initiator| is the origin (scheme + domain) of the page that initiated the request. Set |disable_default_handling| to true (1) to disable default handling of the request, in which case it will need to be handled via cef_resource_request_handler_t::GetResourceHandler or it will be canceled. To allow the resource load to proceed with default handling return NULL. To specify a handler for the resource return a cef_resource_request_handler_t object. If this callback returns NULL the same function will be called on the associated cef_request_context_handler_t, if any.

on_before_browse
int function(cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request, int user_gesture, int is_redirect) nothrow on_before_browse;

Called on the UI thread before browser navigation. Return true (1) to cancel the navigation or false (0) to allow the navigation to proceed. The |request| object cannot be modified in this callback.

on_certificate_error
int function(cef_request_handler_t* self, cef_browser_t* browser, cef_errorcode_t cert_error, const(cef_string_t)* request_url, cef_sslinfo_t* ssl_info, cef_callback_t* callback) nothrow on_certificate_error;

Called on the UI thread to handle requests for URLs with an invalid SSL certificate. Return true (1) and call cef_callback_t functions either in this function or at a later time to continue or cancel the request. Return false (0) to cancel the request immediately. If cef_settings_t.ignore_certificate_errors is set all invalid certificates will be accepted without calling this function.

on_document_available_in_main_frame
void function(cef_request_handler_t* self, cef_browser_t* browser) nothrow on_document_available_in_main_frame;

Called on the browser process UI thread when the window.document object of the main frame has been created.

on_open_urlfrom_tab
int function(cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const(cef_string_t)* target_url, cef_window_open_disposition_t target_disposition, int user_gesture) nothrow on_open_urlfrom_tab;

Called on the UI thread before OnBeforeBrowse in certain limited cases where navigating a new or different browser might be desirable. This includes user-initiated navigation that might open in a special way (e.g. links clicked via middle-click or ctrl + left-click) and certain types of cross-origin navigation initiated from the renderer process (e.g. navigating the top-level frame to/from a file URL). The |browser| and |frame| values represent the source of the navigation. The |target_disposition| value indicates where the user intended to navigate the browser based on standard Chromium behaviors (e.g. current tab, new tab, etc). The |user_gesture| value will be true (1) if the browser navigated via explicit user gesture (e.g. clicking a link) or false (0) if it navigated automatically (e.g. via the DomContentLoaded event). Return true (1) to cancel the navigation or false (0) to allow the navigation to proceed in the source browser's top-level frame.

on_render_process_responsive
void function(cef_request_handler_t* self, cef_browser_t* browser) nothrow on_render_process_responsive;

Called on the browser process UI thread when the render process becomes responsive after previously being unresponsive. See documentation on OnRenderProcessUnresponsive.

on_render_process_terminated
void function(cef_request_handler_t* self, cef_browser_t* browser, cef_termination_status_t status, int error_code, const(cef_string_t)* error_string) nothrow on_render_process_terminated;

Called on the browser process UI thread when the render process terminates unexpectedly. |status| indicates how the process terminated. |error_code| and |error_string| represent the error that would be displayed in Chrome's "Aw, Snap!" view. Possible |error_code| values include cef_resultcode_t non-normal exit values and platform-specific crash values (for example, a Posix signal or Windows hardware exception).

on_render_process_unresponsive
int function(cef_request_handler_t* self, cef_browser_t* browser, cef_unresponsive_process_callback_t* callback) nothrow on_render_process_unresponsive;

Called on the browser process UI thread when the render process is unresponsive as indicated by a lack of input event processing for at least 15 seconds. Return false (0) for the default behavior which is an indefinite wait with the Alloy runtime or display of the "Page unresponsive" dialog with the Chrome runtime. Return true (1) and don't execute the callback for an indefinite wait without display of the Chrome runtime dialog. Return true (1) and call

on_render_view_ready
void function(cef_request_handler_t* self, cef_browser_t* browser) nothrow on_render_view_ready;

Called on the browser process UI thread when the render view associated with |browser| is ready to receive/handle IPC messages in the render process.

on_select_client_certificate
int function(cef_request_handler_t* self, cef_browser_t* browser, int isProxy, const(cef_string_t)* host, int port, size_t certificatesCount, cef_x509certificate_t** certificates, cef_select_client_certificate_callback_t* callback) nothrow on_select_client_certificate;

Called on the UI thread when a client certificate is being requested for authentication. Return false (0) to use the default behavior and automatically select the first certificate available. Return true (1) and call cef_select_client_certificate_callback_t::Select either in this function or at a later time to select a certificate. Do not call Select or call it with NULL to continue without using any certificate. |isProxy| indicates whether the host is an HTTPS proxy or the origin server. |host| and |port| contains the hostname and port of the SSL server. |certificates| is the list of certificates to choose from; this list has already been pruned by Chromium so that it only contains certificates from issuers that the server trusts.

Meta