cef_request_context_t.load_extension

Load an extension.

If extension resources will be read from disk using the default load implementation then |root_directory| should be the absolute path to the extension resources directory and |manifest| should be NULL. If extension resources will be provided by the client (e.g. via cef_request_handler_t and/or cef_extension_handler_t) then |root_directory| should be a path component unique to the extension (if not absolute this will be internally prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the contents that would otherwise be read from the "manifest.json" file on disk.

The loaded extension will be accessible in all contexts sharing the same storage (HasExtension returns true (1)). However, only the context on which this function was called is considered the loader (DidLoadExtension returns true (1)) and only the loader will receive cef_request_context_handler_t callbacks for the extension.

More...
struct cef_request_context_t
extern (System)
void function(cef_request_context_t* self, const(cef_string_t)* root_directory, cef_dictionary_value_t* manifest, cef_extension_handler_t* handler) nothrow load_extension;

Detailed Description

cef extension handler t

:OnExtensionLoaded will be called on load success or cef_extension_handler_t::OnExtensionLoadFailed will be called on load failure.

If the extension specifies a background script via the "background" manifest key then cef_extension_handler_t::OnBeforeBackgroundBrowser will be called to create the background browser. See that function for additional information about background scripts.

For visible extension views the client application should evaluate the manifest to determine the correct extension URL to load and then pass that URL to the cef_browser_host_t::CreateBrowser* function after the extension has loaded. For example, the client can look for the "browser_action" manifest key as documented at https://developer.chrome.com/extensions/browserAction. Extension URLs take the form "chrome-extension://<extension_id>/<path>".

Browsers that host extensions differ from normal browsers as follows: - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit chrome://extensions-support for the list of extension APIs currently supported by CEF. - Main frame navigation to non-extension content is blocked. - Pinch-zooming is disabled. - CefBrowserHost::GetExtension returns the hosted extension. - CefBrowserHost::IsBackgroundHost returns true for background hosts.

See https://developer.chrome.com/extensions for extension implementation and usage documentation.

Meta