Manages the Chromium Embedded Framework (CEF) context for Slate-based UI components. Provides global resource mapping, cookie management, and cross-origin whitelist control for all SCefView instances created in the application.
More...
#include <SlateCefContext.h>
|
| ~FSlateCefContext () |
| Destructor. Cleans up and releases all resources held by the CEF context.
|
|
void | AddLocalFolderResource (const FString &InPath, const FString &InUrl, int32 InPriority=0) |
| Adds a URL mapping for a local web resource directory. All subsequently created SCefView instances will be able to access resources in this directory via the specified URL.
|
|
void | AddArchiveFileResource (const FString &InPath, const FString &InUrl, const FString &InPassword, int32 InPriority=0) |
| Adds a URL mapping for a local archive (.zip) file containing web resources. All subsequently created SCefView instances will be able to access resources in this archive via the specified URL.
|
|
bool | AddCookie (const FString &InName, const FString &InValue, const FString &InDomain, const FString &InUrl) |
| Adds a cookie to the CEF context. The cookie will be accessible from all browsers created with this context.
|
|
bool | DeleteAllCookies () |
| Deletes all cookies from the CEF context.
|
|
bool | AddCrossOriginWhitelistEntry (const FString &InSourceOrigin, const FString &InTargetSchema, const FString &InTargetDomain, bool InAllowTargetSubdomains) |
| Adds an entry to the cross-origin access whitelist, allowing requests from a source origin to a target domain/schema. For more details, see: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L81C23-L81C23.
|
|
bool | RemoveCrossOriginWhitelistEntry (const FString &InSourceOrigin, const FString &InTargetSchema, const FString &InTargetDomain, bool InAllowTargetSubdomains) |
| Removes an entry from the cross-origin access whitelist. For more details, see: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L91C12-L91C12.
|
|
void | ClearCrossOriginWhitelistEntry () |
| Removes all entries from the cross-origin access whitelist for the current context.
|
|
|
static void | Create (const FSlateCefSettings &InSettings) |
| Creates and initializes the global CEF context with the specified settings. If a context already exists, this call has no effect.
|
|
static void | Shutdown () |
| Shuts down and destroys the global CEF context, releasing all associated resources. After shutdown, the context must be re-created before use.
|
|
static bool | IsInitialized () |
| Checks if the CEF context has been initialized and is available for use.
|
|
static FSlateCefContext & | Get () |
| Gets a reference to the current global CEF context instance. Throws if the context is not initialized.
|
|
Manages the Chromium Embedded Framework (CEF) context for Slate-based UI components. Provides global resource mapping, cookie management, and cross-origin whitelist control for all SCefView instances created in the application.
◆ ~FSlateCefContext()
FSlateCefContext::~FSlateCefContext |
( |
| ) |
|
Destructor. Cleans up and releases all resources held by the CEF context.
◆ AddArchiveFileResource()
void FSlateCefContext::AddArchiveFileResource |
( |
const FString & | InPath, |
|
|
const FString & | InUrl, |
|
|
const FString & | InPassword, |
|
|
int32 | InPriority = 0 ) |
Adds a URL mapping for a local archive (.zip) file containing web resources. All subsequently created SCefView instances will be able to access resources in this archive via the specified URL.
- Parameters
-
InPath | The absolute path to the local archive file. |
InUrl | The virtual URL to map to the archive (e.g., "http://archive/"). |
InPassword | The password required to access the archive, if any. |
InPriority | The priority of the mapping. Higher values take precedence. Default is 0. |
◆ AddCookie()
bool FSlateCefContext::AddCookie |
( |
const FString & | InName, |
|
|
const FString & | InValue, |
|
|
const FString & | InDomain, |
|
|
const FString & | InUrl ) |
Adds a cookie to the CEF context. The cookie will be accessible from all browsers created with this context.
- Parameters
-
InName | The name of the cookie. |
InValue | The value of the cookie. |
InDomain | The domain to which the cookie applies. |
InUrl | The URL to which the cookie applies. |
- Returns
- True if the cookie was successfully added; otherwise, false.
◆ AddCrossOriginWhitelistEntry()
bool FSlateCefContext::AddCrossOriginWhitelistEntry |
( |
const FString & | InSourceOrigin, |
|
|
const FString & | InTargetSchema, |
|
|
const FString & | InTargetDomain, |
|
|
bool | InAllowTargetSubdomains ) |
◆ AddLocalFolderResource()
void FSlateCefContext::AddLocalFolderResource |
( |
const FString & | InPath, |
|
|
const FString & | InUrl, |
|
|
int32 | InPriority = 0 ) |
Adds a URL mapping for a local web resource directory. All subsequently created SCefView instances will be able to access resources in this directory via the specified URL.
- Parameters
-
InPath | The absolute path to the local resource directory. |
InUrl | The virtual URL to map to the directory (e.g., "http://local/"). |
InPriority | The priority of the mapping. Higher values take precedence. Default is 0. |
◆ ClearCrossOriginWhitelistEntry()
void FSlateCefContext::ClearCrossOriginWhitelistEntry |
( |
| ) |
|
Removes all entries from the cross-origin access whitelist for the current context.
◆ Create()
Creates and initializes the global CEF context with the specified settings. If a context already exists, this call has no effect.
- Parameters
-
InSettings | CEF context settings to use for initialization. |
◆ DeleteAllCookies()
bool FSlateCefContext::DeleteAllCookies |
( |
| ) |
|
Deletes all cookies from the CEF context.
- Returns
- True if all cookies were successfully deleted; otherwise, false.
◆ Get()
Gets a reference to the current global CEF context instance. Throws if the context is not initialized.
- Returns
- Reference to the current FSlateCefContext.
◆ IsInitialized()
static bool FSlateCefContext::IsInitialized |
( |
| ) |
|
|
static |
Checks if the CEF context has been initialized and is available for use.
- Returns
- True if the context is initialized; otherwise, false.
◆ RemoveCrossOriginWhitelistEntry()
bool FSlateCefContext::RemoveCrossOriginWhitelistEntry |
( |
const FString & | InSourceOrigin, |
|
|
const FString & | InTargetSchema, |
|
|
const FString & | InTargetDomain, |
|
|
bool | InAllowTargetSubdomains ) |
◆ Shutdown()
static void FSlateCefContext::Shutdown |
( |
| ) |
|
|
static |
Shuts down and destroys the global CEF context, releasing all associated resources. After shutdown, the context must be re-created before use.