The OpenD Programming Language

cef_extension_handler_t

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

Members

Variables

base
cef_base_ref_counted_t base;

Base structure.

can_access_browser
int function(cef_extension_handler_t* self, cef_extension_t* extension, cef_browser_t* browser, int include_incognito, cef_browser_t* target_browser) nothrow can_access_browser;

Called when the tabId associated with |target_browser| is specified to an extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the source of the API call. Return true (1) to allow access of false (0) to deny access. Access to incognito browsers should not be allowed unless the source extension has incognito access enabled, in which case |include_incognito| will be true (1).

get_active_browser
cef_browser_t* function(cef_extension_handler_t* self, cef_extension_t* extension, cef_browser_t* browser, int include_incognito) nothrow get_active_browser;

Called when no tabId is specified to an extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the source of the API call. Return the browser that will be acted on by the API call or return NULL to act on |browser|. The returned browser must share the same cef_request_context_t as |browser|. Incognito browsers should not be considered unless the source extension has incognito access enabled, in which case |include_incognito| will be true (1).

get_extension_resource
int function(cef_extension_handler_t* self, cef_extension_t* extension, cef_browser_t* browser, const(cef_string_t)* file, cef_get_extension_resource_callback_t* callback) nothrow get_extension_resource;

Called to retrieve an extension resource that would normally be loaded from disk (e.g. if a file parameter is specified to chrome.tabs.executeScript). |extension| and |browser| are the source of the resource request. |file| is the requested relative file path. To handle the resource request return true (1) and execute |callback| either synchronously or asynchronously. For the default behavior which reads the resource from the extension directory on disk return false (0). Localization substitutions will not be applied to resources handled via this function.

on_before_background_browser
int function(cef_extension_handler_t* self, cef_extension_t* extension, const(cef_string_t)* url, cef_client_t** client, cef_browser_settings_t* settings) nothrow on_before_background_browser;

Called when an extension needs a browser to host a background script specified via the "background" manifest key. The browser will have no visible window and cannot be displayed. |extension| is the extension that is loading the background script. |url| is an internally generated reference to an HTML page that will be used to load the background script via a "<script>" src attribute. To allow creation of the browser optionally modify |client| and |settings| and return false (0). To cancel creation of the browser (and consequently cancel load of the background script) return true (1). Successful creation will be indicated by a call to cef_life_span_handler_t::OnAfterCreated, and

on_before_browser
int function(cef_extension_handler_t* self, cef_extension_t* extension, cef_browser_t* browser, cef_browser_t* active_browser, int index, const(cef_string_t)* url, int active, cef_window_info_t* windowInfo, cef_client_t** client, cef_browser_settings_t* settings) nothrow on_before_browser;

Called when an extension API (e.g. chrome.tabs.create) requests creation of a new browser. |extension| and |browser| are the source of the API call. |active_browser| may optionally be specified via the windowId property or returned via the get_active_browser() callback and provides the default |client| and |settings| values for the new browser. |index| is the position value optionally specified via the index property. |url| is the URL that will be loaded in the browser. |active| is true (1) if the new browser should be active when opened. To allow creation of the browser optionally modify |windowInfo|, |client| and |settings| and return false (0). To cancel creation of the browser return true (1). Successful creation will be indicated by a call to

on_extension_load_failed
void function(cef_extension_handler_t* self, cef_errorcode_t result) nothrow on_extension_load_failed;

Called if the cef_request_context_t::LoadExtension request fails. |result| will be the error code.

on_extension_loaded
void function(cef_extension_handler_t* self, cef_extension_t* extension) nothrow on_extension_loaded;

Called if the cef_request_context_t::LoadExtension request succeeds. |extension| is the loaded extension.

on_extension_unloaded
void function(cef_extension_handler_t* self, cef_extension_t* extension) nothrow on_extension_unloaded;

Called after the cef_extension_t::Unload request has completed.

Detailed Description

cef request context t

:LoadExtension for information about extension loading.

WARNING: This API is deprecated and will be removed in ~M127.

Meta