type ICefExtensionHandler = interface(ICefBaseRefCounted)
Implement this interface to handle events related to browser extensions. The functions of this interface will be called on the UI thread. See ICefRequestContext.LoadExtension for information about extension loading.
WARNING: This API is deprecated and will be removed in ~M127.
UNKNOWN
<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_extension_handler_capi.h">CEF source file: /include/capi/cef_extension_handler_capi.h (cef_extension_handler_t))
procedure OnExtensionLoadFailed(result: TCefErrorcode); |
|
procedure OnExtensionLoaded(const extension: ICefExtension); |
|
procedure OnExtensionUnloaded(const extension: ICefExtension); |
|
function OnBeforeBackgroundBrowser(const extension: ICefExtension; const url: ustring; var client: ICefClient; var settings: TCefBrowserSettings) : boolean; |
|
function OnBeforeBrowser(const extension: ICefExtension; const browser, active_browser: ICefBrowser; index: Integer; const url: ustring; active: boolean; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings) : boolean; |
|
procedure GetActiveBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; var aRsltBrowser: ICefBrowser); |
|
function CanAccessBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser): boolean; |
|
function GetExtensionResource(const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback): boolean; |
|
procedure RemoveReferences; |
procedure OnExtensionLoadFailed(result: TCefErrorcode); |
|
Called if the ICefRequestContext.LoadExtension request fails. |result| will be the error code. Attributes
|
procedure OnExtensionLoaded(const extension: ICefExtension); |
|
Called if the ICefRequestContext.LoadExtension request succeeds. |extension| is the loaded extension. |
procedure OnExtensionUnloaded(const extension: ICefExtension); |
|
Called after the ICefExtension.Unload request has completed. |
function OnBeforeBackgroundBrowser(const extension: ICefExtension; const url: ustring; var client: ICefClient; var settings: TCefBrowserSettings) : boolean; |
|
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 ICefLifeSpanHandler.OnAfterCreated, and ICefBrowserHost.IsBackgroundHost will return true (1) for the resulting browser. See https://developer.chrome.com/extensions/event_pages for more information about extension background script usage. |
function OnBeforeBrowser(const extension: ICefExtension; const browser, active_browser: ICefBrowser; index: Integer; const url: ustring; active: boolean; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings) : boolean; |
|
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 ICefLifeSpanHandler.OnAfterCreated. Any modifications to |windowInfo| will be ignored if |active_browser| is wrapped in a ICefBrowserView. |
procedure GetActiveBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; var aRsltBrowser: ICefBrowser); |
|
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 ICefRequestContext 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). |
function CanAccessBrowser(const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean; const target_browser: ICefBrowser): boolean; |
|
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). |
function GetExtensionResource(const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback): boolean; |
|
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. |
procedure RemoveReferences; |
|
Custom procedure to clear all references. |