Interface ICefRequestContext

Description
Hierarchy
Fields
Methods
Properties

Unit

Declaration

type ICefRequestContext = interface(ICefPreferenceManager)

Description

A request context provides request handling for a set of related browser or URL request objects. A request context can be specified when creating a new browser via the ICefBrowserHost static factory functions or when creating a new URL request via the ICefUrlRequest static factory functions. Browser objects with different request contexts will never be hosted in the same render process. Browser objects with the same request context may or may not be hosted in the same render process depending on the process model. Browser objects created indirectly via the JavaScript window.open function or targeted links will share the same render process and the same request context as the source browser. When running in single-process mode there is only a single render process (the main process) and so all browsers created in single-process mode will share the same request context. This will be the first request context passed into a ICefBrowserHost static factory function and all other request context objects will be ignored.

UNKNOWN

<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_context_capi.h">CEF source file: /include/capi/cef_request_context_capi.h (cef_request_context_t))

Hierarchy

Overview

Methods

Public function IsSame(const other: ICefRequestContext): Boolean;
Public function IsSharingWith(const other: ICefRequestContext): Boolean;
Public function IsGlobal: Boolean;
Public function GetHandler: ICefRequestContextHandler;
Public function GetCachePath: ustring;
Public function GetCookieManager(const callback: ICefCompletionCallback): ICefCookieManager;
Public function GetCookieManagerProc(const callback: TCefCompletionCallbackProc): ICefCookieManager;
Public function RegisterSchemeHandlerFactory(const schemeName, domainName: ustring; const factory: ICefSchemeHandlerFactory): Boolean;
Public function ClearSchemeHandlerFactories: Boolean;
Public procedure ClearCertificateExceptions(const callback: ICefCompletionCallback);
Public procedure ClearHttpAuthCredentials(const callback: ICefCompletionCallback);
Public procedure CloseAllConnections(const callback: ICefCompletionCallback);
Public procedure ResolveHost(const origin: ustring; const callback: ICefResolveCallback);
Public procedure LoadExtension(const root_directory: ustring; const manifest: ICefDictionaryValue; const handler: ICefExtensionHandler);
Public function DidLoadExtension(const extension_id: ustring): boolean;
Public function HasExtension(const extension_id: ustring): boolean;
Public function GetExtensions(const extension_ids: TStringList): boolean;
Public function GetExtension(const extension_id: ustring): ICefExtension;
Public function GetMediaRouter(const callback: ICefCompletionCallback): ICefMediaRouter;
Public function GetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): ICefValue;
Public procedure SetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; const value: ICefValue);
Public function GetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): TCefContentSettingValues;
Public procedure SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);

Properties

Public property CachePath : ustring read GetCachePath;
Public property IsGlobalContext : boolean read IsGlobal;

Description

Methods

Public function IsSame(const other: ICefRequestContext): Boolean;

Returns true (1) if this object is pointing to the same context as |that| object.

Attributes
GUID['{5830847A-2971-4BD5-ABE6-21451F8923F7}']
Public function IsSharingWith(const other: ICefRequestContext): Boolean;

Returns true (1) if this object is sharing the same storage as |that| object.

Public function IsGlobal: Boolean;

Returns true (1) if this object is the global context. The global context is used by default when creating a browser or URL request with a NULL context argument.

Public function GetHandler: ICefRequestContextHandler;

Returns the handler for this context if any.

Public function GetCachePath: ustring;

Returns the cache path for this object. If NULL an "incognito mode" in- memory cache is being used.

Public function GetCookieManager(const callback: ICefCompletionCallback): ICefCookieManager;

Returns the cookie manager for this object. If |callback| is non-NULL it will be executed asnychronously on the UI thread after the manager's storage has been initialized.

Public function GetCookieManagerProc(const callback: TCefCompletionCallbackProc): ICefCookieManager;

Returns the cookie manager for this object. If |callback| is non-NULL it will be executed asnychronously on the UI thread after the manager's storage has been initialized.

Public function RegisterSchemeHandlerFactory(const schemeName, domainName: ustring; const factory: ICefSchemeHandlerFactory): Boolean;

Register a scheme handler factory for the specified |scheme_name| and optional |domain_name|. An NULL |domain_name| value for a standard scheme will cause the factory to match all domain names. The |domain_name| value will be ignored for non-standard schemes. If |scheme_name| is a built-in scheme and no handler is returned by |factory| then the built-in scheme handler factory will be called. If |scheme_name| is a custom scheme then you must also implement the ICefApp.OnRegisterCustomSchemes() function in all processes. This function may be called multiple times to change or remove the factory that matches the specified |scheme_name| and optional |domain_name|. Returns false (0) if an error occurs. This function may be called on any thread in the browser process.

Public function ClearSchemeHandlerFactories: Boolean;

Clear all registered scheme handler factories. Returns false (0) on error. This function may be called on any thread in the browser process.

Public procedure ClearCertificateExceptions(const callback: ICefCompletionCallback);

Clears all certificate exceptions that were added as part of handling ICefRequestHandler.OnCertificateError(). If you call this it is recommended that you also call CloseAllConnections() or you risk not being prompted again for server certificates if you reconnect quickly. If |callback| is non-NULL it will be executed on the UI thread after completion.

Public procedure ClearHttpAuthCredentials(const callback: ICefCompletionCallback);

Clears all HTTP authentication credentials that were added as part of handling GetAuthCredentials. If |callback| is non-NULL it will be executed on the UI thread after completion.

Public procedure CloseAllConnections(const callback: ICefCompletionCallback);

Clears all active and idle connections that Chromium currently has. This is only recommended if you have released all other CEF objects but don't yet want to call cef_shutdown(). If |callback| is non-NULL it will be executed on the UI thread after completion.

Public procedure ResolveHost(const origin: ustring; const callback: ICefResolveCallback);

Attempts to resolve |origin| to a list of associated IP addresses. |callback| will be executed on the UI thread after completion.

Public procedure LoadExtension(const root_directory: ustring; const manifest: ICefDictionaryValue; const handler: ICefExtensionHandler);

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 ICefRequestHandler and/or ICefExtensionHandler) 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 ICefRequestContextHandler callbacks for the extension.

ICefExtensionHandler.OnExtensionLoaded will be called on load success or ICefExtensionHandler.OnExtensionLoadFailed will be called on load failure.

If the extension specifies a background script via the "background" manifest key then ICefExtensionHandler.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 ICefBrowserHost.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.

Public function DidLoadExtension(const extension_id: ustring): boolean;

Returns true (1) if this context was used to load the extension identified by |extension_id|. Other contexts sharing the same storage will also have access to the extension (see HasExtension). This function must be called on the browser process UI thread.

Public function HasExtension(const extension_id: ustring): boolean;

Returns true (1) if this context has access to the extension identified by |extension_id|. This may not be the context that was used to load the extension (see DidLoadExtension). This function must be called on the browser process UI thread.

Public function GetExtensions(const extension_ids: TStringList): boolean;

Retrieve the list of all extensions that this context has access to (see HasExtension). |extension_ids| will be populated with the list of extension ID values. Returns true (1) on success. This function must be called on the browser process UI thread.

Public function GetExtension(const extension_id: ustring): ICefExtension;

Returns the extension matching |extension_id| or NULL if no matching extension is accessible in this context (see HasExtension). This function must be called on the browser process UI thread.

Public function GetMediaRouter(const callback: ICefCompletionCallback): ICefMediaRouter;

Returns the MediaRouter object associated with this context. If |callback| is non-NULL it will be executed asnychronously on the UI thread after the manager's context has been initialized.

Public function GetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): ICefValue;

Returns the current value for |content_type| that applies for the specified URLs. If both URLs are NULL the default value will be returned. Returns nullptr if no value is configured. Must be called on the browser process UI thread.

Public procedure SetWebsiteSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; const value: ICefValue);

Sets the current value for |content_type| for the specified URLs in the default scope. If both URLs are NULL, and the context is not incognito, the default value will be set. Pass nullptr for |value| to remove the default value for this content type.

WARNING: Incorrect usage of this function may cause instability or security issues in Chromium. Make sure that you first understand the potential impact of any changes to |content_type| by reviewing the related source code in Chromium. For example, if you plan to modify CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of ContentSettingsType::POPUPS in Chromium: https://source.chromium.org/search?q=ContentSettingsType::POPUPS

Public function GetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes): TCefContentSettingValues;

Returns the current value for |content_type| that applies for the specified URLs. If both URLs are NULL the default value will be returned. Returns CEF_CONTENT_SETTING_VALUE_DEFAULT if no value is configured. Must be called on the browser process UI thread.

Public procedure SetContentSetting(const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues);

Sets the current value for |content_type| for the specified URLs in the default scope. If both URLs are NULL, and the context is not incognito, the default value will be set. Pass CEF_CONTENT_SETTING_VALUE_DEFAULT for |value| to use the default value for this content type.

WARNING: Incorrect usage of this function may cause instability or security issues in Chromium. Make sure that you first understand the potential impact of any changes to |content_type| by reviewing the related source code in Chromium. For example, if you plan to modify CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of ContentSettingsType::POPUPS in Chromium: https://source.chromium.org/search?q=ContentSettingsType::POPUPS

Properties

Public property CachePath : ustring read GetCachePath;

Returns the cache path for this object. If NULL an "incognito mode" in- memory cache is being used.

Public property IsGlobalContext : boolean read IsGlobal;

Returns true (1) if this object is the global context. The global context is used by default when creating a browser or URL request with a NULL context argument.


Generated by PasDoc 0.16.0-snapshot.