![]() |
UCefView
|
UCefView is a UMG widget that embeds a Chromium Embedded Framework (CEF) browser view within Unreal Engine UI. It provides a rich set of browser features, event hooks, and resource mapping capabilities, allowing seamless integration of web content into Unreal Engine applications. The widget supports navigation, JavaScript execution, event broadcasting, and advanced customization through settings and resource mappings. It is suitable for both in-game and editor use, and exposes a comprehensive set of Blueprint-callable methods and events for interaction. More...
#include <CefView.h>
Public Types | |
using | FOnLoadStateChangedEvent = (*)( const int64& InBrowserId , bool bInIsLoading , bool bInCanGoBack , bool bInCanGoForward ) |
Event triggered when the browser's loading state changes (e.g., starts or finishes loading). | |
using | FOnLoadStartEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InTransitionType ) |
Event triggered when the browser starts loading a new document in any frame. | |
using | FOnLoadEndEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InHttpStatusCode ) |
Event triggered when the browser finishes loading a document in any frame. | |
using | FOnLoadErrorEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InErrorCode , const FString& InErrorMsg , const FString& InFailedUrl ) |
Event triggered when the browser fails to load a document due to an error. | |
using | FOnDraggableRegionChangedEvent = void(*)( const FVector4& InDraggableRegion , const FVector4& InNonDraggableRegion ) |
Event triggered when the draggable or non-draggable regions of the browser change. Used for implementing custom window dragging in frameless windows. | |
using | FOnAddressChangedEvent = void(*)( const FCefFrameId& InFrameId , const FString& InNewAddress ) |
Event triggered when the address (URL) of a frame changes. | |
using | FOnTitleChangedEvent = void(*)( const FString& InTitle ) |
Event triggered when the document title changes. | |
using | FOnFaviconUrlChangedEvent = void(*)( const TArray<FString>& InUrls ) |
Event triggered when the favicon URLs for the current page change. | |
using | FOnFullscreenModeChangedEvent = void(*)( bool bInFullscreen ) |
Event triggered when the browser enters or exits fullscreen mode. | |
using | FOnStatusMessageEvent = void(*)( const FString& InMessage ) |
Event triggered when the browser's status message changes (e.g., link hover, loading status). | |
using | FOnConsoleMessageEvent = void(*)( const FString& InMessage , int32 InLevel ) |
Event triggered when a console message is emitted from web content (e.g., via console.log). | |
using | FOnLoadingProgressChangedEvent = void(*)( double InProgress ) |
Event triggered when the loading progress of the current page changes. | |
using | FOnUrlRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InRequestUrl ) |
Event triggered when a built-in scheme URL is accessed by the browser. Useful for handling custom resource requests. | |
using | FOnQueryRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , UCefViewQuery* InQuery ) |
Event triggered when a new UCefQuery request is received from web content. Used for asynchronous communication between JavaScript and native code. | |
using | FOnInvokeMethodEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InMethod , const FString& InArguments ) |
Event triggered when a method is invoked from web content (JavaScript) via the bridge object. Allows native code to handle custom method calls from JavaScript. | |
using | FOnReportJavascriptResultEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InContext , const FString& InResult ) |
Event triggered when the result of a JavaScript execution (via ExecuteJavascriptWithResult) is returned. | |
using | FOnNativeBrowserCreatedEvent = void(*)() |
Event triggered when the native browser window is created. Note: This event does not fire in OSR (Off-Screen Rendering) mode. | |
Public Member Functions | |
UCefView () | |
Default constructor. Initializes the UCefView widget and its properties. | |
virtual | ~UCefView () |
Destructor. Cleans up resources associated with the CEF browser view. | |
virtual void | SynchronizeProperties () override |
Synchronizes UPROPERTY values with the underlying Slate widget. Called automatically by the engine when properties are changed in the editor or at runtime. | |
virtual void | ReleaseSlateResources (bool bInReleaseChildren) override |
Releases resources held by the Slate widget, optionally releasing child widgets as well. Called when the UMG widget is destroyed or removed from the UI hierarchy. | |
void | AddLocalFolderResource (const FString &InFolderPath, const FString &InTargetUrl, int32 InPriority=0) |
Adds a URL mapping for a local web resource directory, making its contents accessible via a virtual URL. This is useful for serving local HTML, JS, or other assets to the browser. | |
void | AddArchiveFileResource (const FString &InArchivePath, const FString &InTargetUrl, const FString &InPassword="", int32 InPriority=0) |
Adds a URL mapping for a local archive (.zip) file, making its contents accessible via a virtual URL. This is useful for serving packaged web assets to the browser. | |
int64 | GetBrowserId () |
Gets the unique browser ID for this CEF view instance. | |
void | NavigateToUrl (const FString &InTargetUrl) |
Navigates the browser to the specified URL. | |
bool | BrowserCanGoBack () |
Checks whether the browser can navigate back in its history. | |
bool | BrowserCanGoForward () |
Checks whether the browser can navigate forward in its history. | |
void | BrowserGoBack () |
Navigates the browser back to the previous page in its history, if possible. | |
void | BrowserGoForward () |
Navigates the browser forward to the next page in its history, if possible. | |
bool | IsBrowserLoading () |
Checks whether the browser is currently loading a page or resource. | |
void | BrowserReload () |
Reloads the current page in the browser. | |
void | BrowserStopLoad () |
Stops the current page load operation in the browser. | |
bool | TriggerEventForFrame (const UCefViewEvent *InCefViewEvent, const FCefFrameId &InFrameId) |
Triggers a custom event for a specific frame in the CEF view. Allows sending user-defined events to the browser for advanced interaction. | |
bool | TriggerEventForMainFrame (const UCefViewEvent *InCefViewEvent) |
Triggers a custom event for the main frame in the CEF view. | |
bool | BroadcastEvent (const UCefViewEvent *InCefViewEvent) |
Broadcasts a custom event to all frames in the CEF view. | |
bool | ResponseUCefQuery (const UCefViewQuery *InCefQuery) |
Responds to a CEF query with the provided result. Used for asynchronous communication between JavaScript and native code. | |
bool | ExecuteJavascript (const FCefFrameId &InFrameId, const FString &InJavascriptCode, const FString &InTargetUrl) |
Executes JavaScript code in a specific frame of the CEF view. | |
bool | ExecuteJavascriptWithResult (const FCefFrameId &InFrameId, const FString &InJavascriptCode, const FString &InTargetUrl, const FString &InExecuteContext) |
Executes JavaScript code in a specific frame and returns the result asynchronously. | |
bool | SetPreference (const FString &InPreferenceName, const FString &InPreferenceValue, FString &InError) |
Sets a browser preference to a specified value. Preferences control browser behavior such as cache, cookies, and rendering options. | |
void | SetDisablePopupContextMenu (bool bInIsDisable) |
Sets whether to disable the context menu for pop-up browser windows. | |
bool | IsPopupContextMenuDisabled () |
Gets whether the context menu is disabled for pop-up browser windows. | |
bool | HasDevTools () |
Detects whether the browser currently has a DevTools window open. | |
void | ShowDevTools () |
Opens the DevTools dialog for the browser, allowing inspection and debugging of web content. | |
void | CloseDevTools () |
Closes the DevTools dialog if it is currently open. | |
void | SetEnableDragAndDrop (bool bInIsEnable) |
Sets whether to enable drag and drop functionality for the browser. Note: This function does not work for OSR (Off-Screen Rendering) mode. In OSR, dragging a file to a non-dragging area may display the file's content. | |
bool | IsDragAndDropEnabled () const |
Gets whether drag and drop functionality is enabled for the browser. | |
Public Attributes | |
FString | Url |
The initial URL to be loaded in the CEF browser when the widget is created. Can be changed at runtime to navigate to a different page. | |
int32 | FrameRate = 60 |
The frame rate (in frames per second) at which the CEF browser will render. Higher values provide smoother updates but may increase CPU/GPU usage. Default: 60. | |
bool | bEnableContextMenu = true |
Enables or disables the context menu in the CEF browser. If true, right-click context menus are shown; if false, they are suppressed. Default: true. | |
bool | bAcceptDrops = true |
Enables or disables accepting drag-and-drop operations from external sources (e.g., files from OS). If true, the browser can accept drops; if false, drops are ignored. Default: false. | |
bool | bAllowDrag = true |
Enables or disables allowing the browser content to be dragged (initiating drag operations). If true, users can drag content from the browser; if false, dragging is disabled. Default: false. | |
TArray< FLocalFolderResourceMapping > | LocalFolderResroucesMapping |
Mappings for local folders to be used as web resources. Each mapping allows content in the specified folder to be accessed via a virtual URL in the browser. | |
TArray< FArchiveFileResourceMapping > | ArchiveFileResourceMapping |
Mappings for archive files (e.g., .zip) to be used as web resources. Each mapping allows content in the specified archive to be accessed via a virtual URL in the browser. | |
FCefViewSettings | Settings |
Settings for the CEF view, including browser features, font preferences, and other options. These settings are applied when the browser is created and cannot be changed at runtime. | |
FOnLoadStateChangedEvent | OnLoadStateChanged |
FOnLoadStartEvent | OnLoadStart |
FOnLoadEndEvent | OnLoadEnd |
FOnLoadErrorEvent | OnLoadError |
FOnDraggableRegionChangedEvent | OnDraggableRegionChanged |
FOnAddressChangedEvent | OnAddressChanged |
FOnTitleChangedEvent | OnTitleChanged |
FOnFaviconUrlChangedEvent | OnFaviconUrlChanged |
FOnFullscreenModeChangedEvent | OnFullscreenModeChanged |
FOnStatusMessageEvent | OnStatusMessage |
FOnConsoleMessageEvent | OnConsoleMessage |
FOnLoadingProgressChangedEvent | OnLoadingProgressChanged |
FOnUrlRequestEvent | OnUrlRequest |
FOnQueryRequestEvent | OnQueryRequest |
FOnInvokeMethodEvent | OnInvokeMethod |
FOnReportJavascriptResultEvent | OnReportJavascriptResult |
FOnNativeBrowserCreatedEvent | OnNativeBrowserCreated |
Static Public Attributes | |
static const FCefFrameId | MainFrameID |
The main frame identity, representing the primary document frame in the browser. Used for targeting main-frame-specific operations and events. | |
static const FCefFrameId | AllFrameID |
The identifier representing all frames in the browser. Used for broadcasting events or actions to every frame. | |
Protected Member Functions | |
virtual TSharedRef< SWidget > | RebuildWidget () override |
Rebuilds the underlying Slate widget for this UMG widget. Called by the engine when the widget needs to be constructed or updated. | |
void | OnNewBrowser (const FCefFrameId &InSourceFrameId, const FString &InUrl, const FString &InName, ECefWindowOpenDisposition InTargetDisposition, FIntRect &InRect) |
Called before a new browser is created (for browsers created by non-JavaScript means). Allows customization of the new browser's properties and window. | |
bool | OnNewPopup (const FCefFrameId &InFrameId, const FString &InTargetUrl, FString &InTargetFrameName, ECefWindowOpenDisposition InTargetDisposition, FIntRect &InRect, FSlateCefViewSettings &InSettings, bool &bInDisableJavascriptAccess) |
Called before a pop-up browser is created (for browsers created by JavaScript). Allows customization or cancellation of the popup. | |
bool | OnRequestCloseFromWeb () |
Called when a close request is received from the web content (e.g., window.close()). | |
void | OnSlateLoadStateChangedEvent (const int64 &InBrowserId, bool bInIsLoading, bool bInCanGoBack, bool bInCanGoForward) |
Handles the load state changed event from the underlying Slate CEF view. Updates internal state and broadcasts the OnLoadStateChanged event. | |
void | OnSlateLoadStartEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, bool bInIsMainFrame, int InTransitionType) |
Handles the load start event from the underlying Slate CEF view. | |
void | OnSlateLoadEndEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, bool bInIsMainFrame, int InHttpStatusCode) |
Handles the load end event from the underlying Slate CEF view. | |
void | OnSlateLoadErrorEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, bool bInIsMainFrame, int InErrorCode, const FString &InErrorMsg, const FString &InFailedUrl, bool &bInHandled) |
Handles the load error event from the underlying Slate CEF view. | |
void | OnSlateDraggableRegionChangedEvent (const FVector4 &InDraggableRegion, const FVector4 &InNonDraggableRegion) |
Handles the draggable region changed event from the underlying Slate CEF view. Used for updating window drag regions in custom window chrome scenarios. | |
void | OnSlateAddressChangedEvent (const FCefFrameId &InFrameId, const FString &InNewAddress) |
Handles the address changed event from the underlying Slate CEF view. | |
void | OnSlateTitleChangedEvent (const FString &InTitle) |
Handles the title changed event from the underlying Slate CEF view. | |
void | OnSlateFaviconUrlChangedEvent (const TArray< FString > &InUrls) |
Handles the favicon URL changed event from the underlying Slate CEF view. | |
void | OnSlateFullscreenModeChangedEvent (bool bInFullscreen) |
Handles the fullscreen mode changed event from the underlying Slate CEF view. | |
void | OnSlateStatusMessageEvent (const FString &InMessage) |
Handles the status message event from the underlying Slate CEF view. | |
void | OnSlateConsoleMessageEvent (const FString &InMessage, int32 InLevel) |
Handles the console message event from the underlying Slate CEF view. | |
void | OnSlateLoadingProgressChangedEvent (double InProgress) |
Handles the loading progress changed event from the underlying Slate CEF view. | |
void | OnSlateUrlRequestEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, const FString &InRequestUrl) |
Handles the URL request event from the underlying Slate CEF view. | |
void | OnSlateQueryRequestEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, const int64 &InQueryId, const FString &InRequest) |
Handles the query request event from the underlying Slate CEF view. | |
void | OnSlateInvokeMethodEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, const FString &InMethod, const TArray< TSharedPtr< FJsonValue > > &InArguments) |
Handles the invoke method event from the underlying Slate CEF view. | |
void | OnSlateReportJavascriptResultEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, const FString &InContext, const TSharedPtr< FJsonValue > &InResult) |
Handles the report JavaScript result event from the underlying Slate CEF view. | |
void | OnSlateNativeBrowserCreatedEvent () |
Handles the native browser created event from the underlying Slate CEF view. Used to perform additional initialization after the browser window is available. | |
Protected Attributes | |
TSharedPtr< SCefView > | SlateCefView |
UCefView is a UMG widget that embeds a Chromium Embedded Framework (CEF) browser view within Unreal Engine UI. It provides a rich set of browser features, event hooks, and resource mapping capabilities, allowing seamless integration of web content into Unreal Engine applications. The widget supports navigation, JavaScript execution, event broadcasting, and advanced customization through settings and resource mappings. It is suitable for both in-game and editor use, and exposes a comprehensive set of Blueprint-callable methods and events for interaction.
using UCefView::FOnAddressChangedEvent = void(*)( const FCefFrameId& InFrameId , const FString& InNewAddress ) |
Event triggered when the address (URL) of a frame changes.
InFrameId | The frame ID whose address changed. |
InNewAddress | The new address (URL). |
using UCefView::FOnConsoleMessageEvent = void(*)( const FString& InMessage , int32 InLevel ) |
Event triggered when a console message is emitted from web content (e.g., via console.log).
InMessage | The console message text. |
InLevel | The log level (e.g., info, warning, error). |
using UCefView::FOnDraggableRegionChangedEvent = void(*)( const FVector4& InDraggableRegion , const FVector4& InNonDraggableRegion ) |
Event triggered when the draggable or non-draggable regions of the browser change. Used for implementing custom window dragging in frameless windows.
InDraggableRegion | The new draggable region (as a vector or rectangle). |
InNonDraggableRegion | The new non-draggable region. |
using UCefView::FOnFaviconUrlChangedEvent = void(*)( const TArray<FString>& InUrls ) |
Event triggered when the favicon URLs for the current page change.
InUrls | The new list of favicon URLs. |
using UCefView::FOnFullscreenModeChangedEvent = void(*)( bool bInFullscreen ) |
Event triggered when the browser enters or exits fullscreen mode.
bInFullscreen | True if the browser is now in fullscreen mode; otherwise, false. |
using UCefView::FOnInvokeMethodEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InMethod , const FString& InArguments ) |
Event triggered when a method is invoked from web content (JavaScript) via the bridge object. Allows native code to handle custom method calls from JavaScript.
InBrowserId | The unique browser ID. |
InFrameId | The frame ID making the call. |
InMethod | The name of the method being invoked. |
InArguments | The arguments list as a JSON string. |
using UCefView::FOnLoadEndEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InHttpStatusCode ) |
Event triggered when the browser finishes loading a document in any frame.
InBrowserId | The unique browser ID. |
InFrameId | The frame ID where loading ended. |
bInIsMainFrame | True if this is the main frame; otherwise, false. |
InHttpStatusCode | The HTTP status code of the loaded document. |
using UCefView::FOnLoadErrorEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InErrorCode , const FString& InErrorMsg , const FString& InFailedUrl ) |
Event triggered when the browser fails to load a document due to an error.
InBrowserId | The unique browser ID. |
InFrameId | The frame ID where the error occurred. |
bInIsMainFrame | True if this is the main frame; otherwise, false. |
InErrorCode | The error code (see CEF error codes). |
InErrorMsg | A descriptive error message. |
InFailedUrl | The URL that failed to load. |
using UCefView::FOnLoadingProgressChangedEvent = void(*)( double InProgress ) |
Event triggered when the loading progress of the current page changes.
InProgress | The current loading progress (0.0 to 1.0). |
using UCefView::FOnLoadStartEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InTransitionType ) |
Event triggered when the browser starts loading a new document in any frame.
InBrowserId | The unique browser ID. |
InFrameId | The frame ID where loading started. |
bInIsMainFrame | True if this is the main frame; otherwise, false. |
InTransitionType | The transition type (navigation reason). |
using UCefView::FOnLoadStateChangedEvent = (*)( const int64& InBrowserId , bool bInIsLoading , bool bInCanGoBack , bool bInCanGoForward ) |
Event triggered when the browser's loading state changes (e.g., starts or finishes loading).
InBrowserId | The unique browser ID. |
bInIsLoading | True if the browser is currently loading; otherwise, false. |
bInCanGoBack | True if the browser can navigate back; otherwise, false. |
bInCanGoForward | True if the browser can navigate forward; otherwise, false. |
using UCefView::FOnNativeBrowserCreatedEvent = void(*)() |
Event triggered when the native browser window is created. Note: This event does not fire in OSR (Off-Screen Rendering) mode.
using UCefView::FOnQueryRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , UCefViewQuery* InQuery ) |
Event triggered when a new UCefQuery request is received from web content. Used for asynchronous communication between JavaScript and native code.
InBrowserId | The unique browser ID. |
InFrameId | The frame ID making the query. |
InQuery | The query request object. |
using UCefView::FOnReportJavascriptResultEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InContext , const FString& InResult ) |
Event triggered when the result of a JavaScript execution (via ExecuteJavascriptWithResult) is returned.
InBrowserId | The unique browser ID. |
InFrameId | The frame ID where the script was executed. |
InContext | The execution context identifier. |
InResult | The result of the JavaScript execution as a string. |
using UCefView::FOnStatusMessageEvent = void(*)( const FString& InMessage ) |
Event triggered when the browser's status message changes (e.g., link hover, loading status).
InMessage | The new status message. |
using UCefView::FOnTitleChangedEvent = void(*)( const FString& InTitle ) |
Event triggered when the document title changes.
InTitle | The new document title. |
using UCefView::FOnUrlRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InRequestUrl ) |
Event triggered when a built-in scheme URL is accessed by the browser. Useful for handling custom resource requests.
InBrowserId | The unique browser ID. |
InFrameId | The frame ID making the request. |
InRequestUrl | The full requested URL. |
UCefView::UCefView | ( | ) |
Default constructor. Initializes the UCefView widget and its properties.
|
virtual |
Destructor. Cleans up resources associated with the CEF browser view.
void UCefView::AddArchiveFileResource | ( | const FString & | InArchivePath, |
const FString & | InTargetUrl, | ||
const FString & | InPassword = "", | ||
int32 | InPriority = 0 ) |
Adds a URL mapping for a local archive (.zip) file, making its contents accessible via a virtual URL. This is useful for serving packaged web assets to the browser.
InArchivePath | The absolute or relative path to the local archive file. |
InTargetUrl | The virtual URL to map to the archive (e.g., "http://archive/"). |
InPassword | The password required to access the archive, if any. Default is empty. |
InPriority | The priority of the mapping. Higher values take precedence. Default is 0. |
void UCefView::AddLocalFolderResource | ( | const FString & | InFolderPath, |
const FString & | InTargetUrl, | ||
int32 | InPriority = 0 ) |
Adds a URL mapping for a local web resource directory, making its contents accessible via a virtual URL. This is useful for serving local HTML, JS, or other assets to the browser.
InFolderPath | The absolute or relative path to the local resource directory. |
InTargetUrl | 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. |
bool UCefView::BroadcastEvent | ( | const UCefViewEvent * | InCefViewEvent | ) |
Broadcasts a custom event to all frames in the CEF view.
InCefViewEvent | The event object to broadcast. |
bool UCefView::BrowserCanGoBack | ( | ) |
Checks whether the browser can navigate back in its history.
bool UCefView::BrowserCanGoForward | ( | ) |
Checks whether the browser can navigate forward in its history.
void UCefView::BrowserGoBack | ( | ) |
Navigates the browser back to the previous page in its history, if possible.
void UCefView::BrowserGoForward | ( | ) |
Navigates the browser forward to the next page in its history, if possible.
void UCefView::BrowserReload | ( | ) |
Reloads the current page in the browser.
void UCefView::BrowserStopLoad | ( | ) |
Stops the current page load operation in the browser.
void UCefView::CloseDevTools | ( | ) |
Closes the DevTools dialog if it is currently open.
bool UCefView::ExecuteJavascript | ( | const FCefFrameId & | InFrameId, |
const FString & | InJavascriptCode, | ||
const FString & | InTargetUrl ) |
Executes JavaScript code in a specific frame of the CEF view.
InFrameId | The ID of the frame in which to execute the JavaScript. |
InJavascriptCode | The JavaScript code to execute. |
InTargetUrl | The URL to associate with the script (used for debugging and stack traces). |
bool UCefView::ExecuteJavascriptWithResult | ( | const FCefFrameId & | InFrameId, |
const FString & | InJavascriptCode, | ||
const FString & | InTargetUrl, | ||
const FString & | InExecuteContext ) |
Executes JavaScript code in a specific frame and returns the result asynchronously.
InFrameId | The ID of the frame in which to execute the JavaScript. |
InJavascriptCode | The JavaScript code to execute. |
InTargetUrl | The URL to associate with the script (used for debugging and stack traces). |
InExecuteContext | The context in which the script is executed (e.g., "default", "isolated"). |
int64 UCefView::GetBrowserId | ( | ) |
Gets the unique browser ID for this CEF view instance.
bool UCefView::HasDevTools | ( | ) |
Detects whether the browser currently has a DevTools window open.
bool UCefView::IsBrowserLoading | ( | ) |
Checks whether the browser is currently loading a page or resource.
bool UCefView::IsDragAndDropEnabled | ( | ) | const |
Gets whether drag and drop functionality is enabled for the browser.
bool UCefView::IsPopupContextMenuDisabled | ( | ) |
Gets whether the context menu is disabled for pop-up browser windows.
void UCefView::NavigateToUrl | ( | const FString & | InTargetUrl | ) |
Navigates the browser to the specified URL.
InTargetUrl | The URL to navigate to. |
|
protected |
Called before a new browser is created (for browsers created by non-JavaScript means). Allows customization of the new browser's properties and window.
InSourceFrameId | The source frame ID initiating the new browser. |
InUrl | The target URL to be loaded in the new browser. |
InName | The target window name. |
InTargetDisposition | The method by which the window should be opened (e.g., new tab, new window). |
InRect | The rectangle specifying the popup window's position and size. |
|
protected |
Called before a pop-up browser is created (for browsers created by JavaScript). Allows customization or cancellation of the popup.
InFrameId | The source frame ID. |
InTargetUrl | The target URL for the popup. |
InTargetFrameName | The target frame name (modifiable). |
InTargetDisposition | The method by which the window should be opened. |
InRect | The rectangle specifying the popup window's position and size. |
InSettings | Settings to be applied to the popup browser. |
bInDisableJavascriptAccess | Set to true to disable JavaScript access in the popup. |
|
protected |
Called when a close request is received from the web content (e.g., window.close()).
|
protected |
Handles the address changed event from the underlying Slate CEF view.
InFrameId | The frame ID whose address changed. |
InNewAddress | The new address (URL). |
|
protected |
Handles the console message event from the underlying Slate CEF view.
InMessage | The console message. |
InLevel | The log level. |
|
protected |
Handles the draggable region changed event from the underlying Slate CEF view. Used for updating window drag regions in custom window chrome scenarios.
InDraggableRegion | The new draggable region. |
InNonDraggableRegion | The new non-draggable region. |
|
protected |
Handles the favicon URL changed event from the underlying Slate CEF view.
InUrls | The new favicon URLs. |
|
protected |
Handles the fullscreen mode changed event from the underlying Slate CEF view.
bInFullscreen | True if fullscreen; otherwise, false. |
|
protected |
Handles the invoke method event from the underlying Slate CEF view.
InBrowserId | The browser ID. |
InFrameId | The frame ID. |
InMethod | The method name to invoke. |
InArguments | The arguments as a JSON value array. |
|
protected |
Handles the load end event from the underlying Slate CEF view.
InBrowserId | The browser ID. |
InFrameId | The frame ID. |
bInIsMainFrame | True if main frame; otherwise, false. |
InHttpStatusCode | The HTTP status code. |
|
protected |
Handles the load error event from the underlying Slate CEF view.
InBrowserId | The browser ID. |
InFrameId | The frame ID. |
bInIsMainFrame | True if main frame; otherwise, false. |
InErrorCode | The error code. |
InErrorMsg | The error message. |
InFailedUrl | The URL that failed to load. |
bInHandled | Set to true if the error was handled; otherwise, false. |
|
protected |
Handles the loading progress changed event from the underlying Slate CEF view.
InProgress | The loading progress (0.0 to 1.0). |
|
protected |
Handles the load start event from the underlying Slate CEF view.
InBrowserId | The browser ID. |
InFrameId | The frame ID. |
bInIsMainFrame | True if main frame; otherwise, false. |
InTransitionType | The navigation transition type. |
|
protected |
Handles the load state changed event from the underlying Slate CEF view. Updates internal state and broadcasts the OnLoadStateChanged event.
InBrowserId | The browser ID. |
bInIsLoading | True if loading; otherwise, false. |
bInCanGoBack | True if can go back; otherwise, false. |
bInCanGoForward | True if can go forward; otherwise, false. |
|
protected |
Handles the native browser created event from the underlying Slate CEF view. Used to perform additional initialization after the browser window is available.
|
protected |
Handles the query request event from the underlying Slate CEF view.
InBrowserId | The browser ID. |
InFrameId | The frame ID. |
InQueryId | The query ID. |
InRequest | The query request string. |
|
protected |
Handles the report JavaScript result event from the underlying Slate CEF view.
InBrowserId | The browser ID. |
InFrameId | The frame ID. |
InContext | The JavaScript execution context. |
InResult | The result as a JSON value. |
|
protected |
Handles the status message event from the underlying Slate CEF view.
InMessage | The status message. |
|
protected |
Handles the title changed event from the underlying Slate CEF view.
InTitle | The new document title. |
|
protected |
Handles the URL request event from the underlying Slate CEF view.
InBrowserId | The browser ID. |
InFrameId | The frame ID. |
InRequestUrl | The requested URL. |
|
overrideprotectedvirtual |
Rebuilds the underlying Slate widget for this UMG widget. Called by the engine when the widget needs to be constructed or updated.
|
overridevirtual |
Releases resources held by the Slate widget, optionally releasing child widgets as well. Called when the UMG widget is destroyed or removed from the UI hierarchy.
bInReleaseChildren | If true, releases child widgets as well. |
bool UCefView::ResponseUCefQuery | ( | const UCefViewQuery * | InCefQuery | ) |
Responds to a CEF query with the provided result. Used for asynchronous communication between JavaScript and native code.
InCefQuery | The CEF query object to respond to. |
void UCefView::SetDisablePopupContextMenu | ( | bool | bInIsDisable | ) |
Sets whether to disable the context menu for pop-up browser windows.
bInIsDisable | True to disable the context menu; false to enable it. |
void UCefView::SetEnableDragAndDrop | ( | bool | bInIsEnable | ) |
Sets whether to enable drag and drop functionality for the browser. Note: This function does not work for OSR (Off-Screen Rendering) mode. In OSR, dragging a file to a non-dragging area may display the file's content.
bInIsEnable | True to enable drag and drop; false to disable. |
In OSR mode, additional handling may be required to prevent unwanted file display.
bool UCefView::SetPreference | ( | const FString & | InPreferenceName, |
const FString & | InPreferenceValue, | ||
FString & | InError ) |
Sets a browser preference to a specified value. Preferences control browser behavior such as cache, cookies, and rendering options.
InPreferenceName | The name of the preference to set (e.g., "webkit.webprefs.javascript_enabled"). |
InPreferenceValue | The value to set the preference to (as a string). |
InError | An output parameter that will contain an error message if the preference could not be set. |
void UCefView::ShowDevTools | ( | ) |
Opens the DevTools dialog for the browser, allowing inspection and debugging of web content.
|
overridevirtual |
Synchronizes UPROPERTY values with the underlying Slate widget. Called automatically by the engine when properties are changed in the editor or at runtime.
bool UCefView::TriggerEventForFrame | ( | const UCefViewEvent * | InCefViewEvent, |
const FCefFrameId & | InFrameId ) |
Triggers a custom event for a specific frame in the CEF view. Allows sending user-defined events to the browser for advanced interaction.
InCefViewEvent | The event object to trigger. |
InFrameId | The ID of the frame to trigger the event on. |
bool UCefView::TriggerEventForMainFrame | ( | const UCefViewEvent * | InCefViewEvent | ) |
Triggers a custom event for the main frame in the CEF view.
InCefViewEvent | The event object to trigger. |
|
static |
The identifier representing all frames in the browser. Used for broadcasting events or actions to every frame.
TArray<FArchiveFileResourceMapping> UCefView::ArchiveFileResourceMapping |
Mappings for archive files (e.g., .zip) to be used as web resources. Each mapping allows content in the specified archive to be accessed via a virtual URL in the browser.
bool UCefView::bAcceptDrops = true |
Enables or disables accepting drag-and-drop operations from external sources (e.g., files from OS). If true, the browser can accept drops; if false, drops are ignored. Default: false.
bool UCefView::bAllowDrag = true |
Enables or disables allowing the browser content to be dragged (initiating drag operations). If true, users can drag content from the browser; if false, dragging is disabled. Default: false.
bool UCefView::bEnableContextMenu = true |
Enables or disables the context menu in the CEF browser. If true, right-click context menus are shown; if false, they are suppressed. Default: true.
int32 UCefView::FrameRate = 60 |
The frame rate (in frames per second) at which the CEF browser will render. Higher values provide smoother updates but may increase CPU/GPU usage. Default: 60.
TArray<FLocalFolderResourceMapping> UCefView::LocalFolderResroucesMapping |
Mappings for local folders to be used as web resources. Each mapping allows content in the specified folder to be accessed via a virtual URL in the browser.
|
static |
The main frame identity, representing the primary document frame in the browser. Used for targeting main-frame-specific operations and events.
FOnAddressChangedEvent UCefView::OnAddressChanged |
FOnConsoleMessageEvent UCefView::OnConsoleMessage |
FOnDraggableRegionChangedEvent UCefView::OnDraggableRegionChanged |
FOnFaviconUrlChangedEvent UCefView::OnFaviconUrlChanged |
FOnFullscreenModeChangedEvent UCefView::OnFullscreenModeChanged |
FOnInvokeMethodEvent UCefView::OnInvokeMethod |
FOnLoadEndEvent UCefView::OnLoadEnd |
FOnLoadErrorEvent UCefView::OnLoadError |
FOnLoadingProgressChangedEvent UCefView::OnLoadingProgressChanged |
FOnLoadStartEvent UCefView::OnLoadStart |
FOnLoadStateChangedEvent UCefView::OnLoadStateChanged |
FOnNativeBrowserCreatedEvent UCefView::OnNativeBrowserCreated |
FOnQueryRequestEvent UCefView::OnQueryRequest |
FOnReportJavascriptResultEvent UCefView::OnReportJavascriptResult |
FOnStatusMessageEvent UCefView::OnStatusMessage |
FOnTitleChangedEvent UCefView::OnTitleChanged |
FOnUrlRequestEvent UCefView::OnUrlRequest |
FCefViewSettings UCefView::Settings |
Settings for the CEF view, including browser features, font preferences, and other options. These settings are applied when the browser is created and cannot be changed at runtime.
|
protected |
FString UCefView::Url |
The initial URL to be loaded in the CEF browser when the widget is created. Can be changed at runtime to navigate to a different page.