UCefView
Loading...
Searching...
No Matches
UCefView

Represents a UMG widget contains a CEF browser view (wrapped by Slate Widget). More...

#include <CefView.h>

Public Types

using FOnLoadStateChangedEvent = (*)( const int64& InBrowserId , bool bInIsLoading , bool bInCanGoBack , bool bInCanGoForward )
 The callback type of loading state changed.
 
using FOnLoadStartEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InTransitionType )
 The callback type of loading starts.
 
using FOnLoadEndEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InHttpStatusCode )
 The callback type of loading ends.
 
using FOnLoadErrorEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InErrorCode , const FString& InErrorMsg , const FString& InFailedUrl )
 The callback type of loading failed due to error.
 
using FOnDraggableRegionChangedEvent = void(*)( const FVector4& InDraggableRegion , const FVector4& InNonDraggableRegion )
 The callback type of draggable region changed.
 
using FOnAddressChangedEvent = void(*)( const FCefFrameId& InFrameId , const FString& InNewAddress )
 The callback type of the address changed.
 
using FOnTitleChangedEvent = void(*)( const FString& InTitle )
 The callback type of title changed.
 
using FOnFaviconUrlChangedEvent = void(*)( const TArray<FString>& InUrls )
 The callback type of favicon url changed.
 
using FOnFullscreenModeChangedEvent = void(*)( bool bInFullscreen )
 The callback type of fullscreen mode changed.
 
using FOnStatusMessageEvent = void(*)( const FString& InMessage )
 The callback type of status message changed.
 
using FOnConsoleMessageEvent = void(*)( const FString& InMessage , int32 InLevel )
 The callback type of console message from the web content.
 
using FOnLoadingProgressChangedEvent = void(*)( double InProgress )
 The callback type of loading progress changed.
 
using FOnUrlRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InRequestUrl )
 The callback type of built-in scheme URL access.
 
using FOnQueryRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , UCefViewQuery* InQuery )
 The callback type of new UCefQuery request.
 
using FOnInvokeMethodEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InMethod , const FString& InArguments )
 The callback type of invoking method request from web content(Javascript).
 
using FOnReportJavascriptResultEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InContext , const FString& InResult )
 The callback type of the result of the javascript executed with executeJavascriptWithResult returned.
 
using FOnNativeBrowserCreatedEvent = void(*)()
 The callback type of the native browser window created event. This slot does not work for OSR mode.
 

Public Member Functions

 UCefView ()
 
virtual ~UCefView ()
 
virtual void SynchronizeProperties () override
 
virtual void ReleaseSlateResources (bool bInReleaseChildren) override
 
void AddLocalFolderResource (const FString &InFolderPath, const FString &InTargetUrl, int32 InPriority=0)
 Adds a url mapping item with local web resource directory.
 
void AddArchiveFileResource (const FString &InArchivePath, const FString &InTargetUrl, const FString &InPassword="", int32 InPriority=0)
 Adds a url mapping item with local archive (.zip) file which contains the web resource.
 
int64 GetBrowserId ()
 Gets the browser id.
 
void NavigateToUrl (const FString &InTargetUrl)
 Navigates to the URL.
 
bool BrowserCanGoBack ()
 Checks whether the browser can go back.
 
bool BrowserCanGoForward ()
 Checks whether the browser can go forward.
 
void BrowserGoBack ()
 Requires the browser to go back.
 
void BrowserGoForward ()
 Requires the browser to go forward.
 
bool IsBrowserLoading ()
 Checks whether the browser is loading.
 
void BrowserReload ()
 Requires the browser to reload.
 
void BrowserStopLoad ()
 Requires the browser to stop load.
 
bool TriggerEventForFrame (const UCefViewEvent *InCefViewEvent, const FCefFrameId &InFrameId)
 Triggers an event for a specific frame in the CEF view.
 
bool TriggerEventForMainFrame (const UCefViewEvent *InCefViewEvent)
 Triggers an event for the main frame in the CEF view.
 
bool BroadcastEvent (const UCefViewEvent *InCefViewEvent)
 Broadcasts an event to all frames in the CEF view.
 
bool ResponseUCefQuery (const UCefViewQuery *InCefQuery)
 Responses to a CEF query with the provided result.
 
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.
 
bool SetPreference (const FString &InPreferenceName, const FString &InPreferenceValue, FString &InError)
 Sets a preference in the CEF browser.
 
void SetDisablePopupContextMenu (bool bInIsDisable)
 Sets whether to disable the context menu for pop-up browser.
 
bool IsPopupContextMenuDisabled ()
 Gets whether to disable the context menu for pop-up browser.
 
bool HasDevTools ()
 Detects whether this browser has a dev-tools opened.
 
void ShowDevTools ()
 Opens the dev-tools dialog.
 
void CloseDevTools ()
 Closes the dev-tools dialog.
 
void SetEnableDragAndDrop (bool bInIsEnable)
 Sets whether to enable drag and drop.
 
bool IsDragAndDropEnabled () const
 Gets whether to enable drag and drop.
 

Public Attributes

FString Url
 The URL to be loaded in the CEF browser.
 
bool EnableContextMenu = true
 Enables or disables the context menu in the CEF browser.
 
bool EnableDragAndDrop = false
 Enables or disables drag and drop functionality in the CEF browser.
 
int32 FrameRate = 60
 The frame rate at which the CEF browser will render.
 
FColor BackgroundColor = FColor::White
 The background color of the CEF browser.
 
TArray< FLocalFolderResourceMappingLocalFolderResroucesMapping
 Mappings for local folders to be used as web resources.
 
TArray< FArchiveFileResourceMappingArchiveFileResourceMapping
 Mappings for archive files to be used as web resources.
 
FString StandardFontFamily
 The standard font family for the CEF browser.
 
FString FixedFontFamily
 The fixed font family for the CEF browser.
 
FString SerifFontFamily
 The serif font family for the CEF browser.
 
FString SansSerifFontFamily
 The sans-serif font family for the CEF browser.
 
FString CursiveFontFamily
 The cursive font family for the CEF browser.
 
FString FantasyFontFamily
 The fantasy font family for the CEF browser.
 
int32 DefaultFontSize
 The default font size for the CEF browser.
 
int32 DefaultFixedFontSize
 The default fixed font size for the CEF browser.
 
int32 MinimumFontSize
 The minimum font size for the CEF browser.
 
int32 MinimumLogicalFontSize
 The minimum logical font size for the CEF browser.
 
FString DefaultEncoding
 The default encoding for the CEF browser.
 
FString AcceptLanguageList
 The accept language list for the CEF browser.
 
ECefViewFeatureState RemoteFonts
 Whether remote fonts are enabled for the CEF browser.
 
ECefViewFeatureState Javascript = ECefViewFeatureState::Default
 Whether JavaScript is enabled for the CEF browser.
 
ECefViewFeatureState AllowJavascriptCloseWindows = ECefViewFeatureState::Default
 Whether JavaScript can close windows in the CEF browser.
 
ECefViewFeatureState AllowJavascriptAccessClipboard = ECefViewFeatureState::Default
 Whether JavaScript can access the clipboard in the CEF browser.
 
ECefViewFeatureState AllowJavascriptDomPaste = ECefViewFeatureState::Default
 Whether JavaScript can paste from the DOM in the CEF browser.
 
ECefViewFeatureState Plugins = ECefViewFeatureState::Default
 Whether plugins are enabled for the CEF browser.
 
ECefViewFeatureState ImageLoading = ECefViewFeatureState::Default
 Whether images are loading for the CEF browser.
 
ECefViewFeatureState ImageShrinkStandaloneToFit = ECefViewFeatureState::Default
 Whether images shrink standalone to fit for the CEF browser.
 
ECefViewFeatureState TextAreaResize = ECefViewFeatureState::Default
 Whether text areas can be resized for the CEF browser.
 
ECefViewFeatureState TabToLinks = ECefViewFeatureState::Default
 Whether tabs can be used to navigate links for the CEF browser.
 
ECefViewFeatureState LocalStorage = ECefViewFeatureState::Default
 Whether local storage is enabled for the CEF browser.
 
ECefViewFeatureState Databases = ECefViewFeatureState::Default
 Whether databases are enabled for the CEF browser.
 
ECefViewFeatureState WebGL = ECefViewFeatureState::Default
 Whether WebGL is enabled for the CEF browser.
 
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.
 
static const FCefFrameId AllFrameID
 The identifier for all frames.
 

Protected Member Functions

virtual TSharedRef< SWidget > RebuildWidget () override
 
void OnNewBrowser (const FCefFrameId &InSourceFrameId, const FString &InUrl, const FString &InName, ECefWindowOpenDisposition InTargetDisposition, FIntRect &InRect)
 Gets called before a new browser created (only for browser created by non-JavaScript).
 
bool OnNewPopup (const FCefFrameId &InFrameId, const FString &InTargetUrl, FString &InTargetFrameName, ECefWindowOpenDisposition InTargetDisposition, FIntRect &InRect, FCefViewSettings &InSettings, bool &bInDisableJavascriptAccess)
 Gets called before the pop-up browser is created (only for browsers created by JavaScript).
 
bool OnRequestCloseFromWeb ()
 Gets called when close request received from the web.
 
void OnSlateLoadStateChangedEvent (const int64 &InBrowserId, bool bInIsLoading, bool bInCanGoBack, bool bInCanGoForward)
 Handles the load state changed event from the Slate CEF view.
 
void OnSlateLoadStartEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, bool bInIsMainFrame, int InTransitionType)
 Handles the load start event from the Slate CEF view.
 
void OnSlateLoadEndEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, bool bInIsMainFrame, int InHttpStatusCode)
 Handles the load end event from the 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 Slate CEF view.
 
void OnSlateDraggableRegionChangedEvent (const FVector4 &InDraggableRegion, const FVector4 &InNonDraggableRegion)
 Handles the draggable region changed event from the Slate CEF view.
 
void OnSlateAddressChangedEvent (const FCefFrameId &InFrameId, const FString &InNewAddress)
 Handles the address changed event from the Slate CEF view.
 
void OnSlateTitleChangedEvent (const FString &InTitle)
 Handles the title changed event from the Slate CEF view.
 
void OnSlateFaviconUrlChangedEvent (const TArray< FString > &InUrls)
 Handles the favicon URL changed event from the Slate CEF view.
 
void OnSlateFullscreenModeChangedEvent (bool bInFullscreen)
 Handles the fullscreen mode changed event from the Slate CEF view.
 
void OnSlateStatusMessageEvent (const FString &InMessage)
 Handles the status message event from the Slate CEF view.
 
void OnSlateConsoleMessageEvent (const FString &InMessage, int32 InLevel)
 Handles the console message event from the Slate CEF view.
 
void OnSlateLoadingProgressChangedEvent (double InProgress)
 Handles the loading progress changed event from the Slate CEF view.
 
void OnSlateUrlRequestEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, const FString &InRequestUrl)
 Handles the URL request event from the Slate CEF view.
 
void OnSlateQueryRequestEvent (const int64 &InBrowserId, const FCefFrameId &InFrameId, const int64 &InQueryId, const FString &InRequest)
 Handles the query request event from the 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 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 Slate CEF view.
 
void OnSlateNativeBrowserCreatedEvent ()
 Handles the native browser created event from the Slate CEF view.
 

Protected Attributes

TSharedPtr< SCefViewSlateCefView
 

Detailed Description

Represents a UMG widget contains a CEF browser view (wrapped by Slate Widget).

Member Typedef Documentation

◆ FOnAddressChangedEvent

using UCefView::FOnAddressChangedEvent = void(*)( const FCefFrameId& InFrameId , const FString& InNewAddress )

The callback type of the address changed.

Parameters
InFrameIdThe frame id.
InNewAddressThe address.

◆ FOnConsoleMessageEvent

using UCefView::FOnConsoleMessageEvent = void(*)( const FString& InMessage , int32 InLevel )

The callback type of console message from the web content.

Parameters
InMessageThe message.
InLevelThe level.

◆ FOnDraggableRegionChangedEvent

using UCefView::FOnDraggableRegionChangedEvent = void(*)( const FVector4& InDraggableRegion , const FVector4& InNonDraggableRegion )

The callback type of draggable region changed.

Parameters
InDraggableRegionThe new draggable region.
InNonDraggableRegionThe new non-draggable region.

◆ FOnFaviconUrlChangedEvent

using UCefView::FOnFaviconUrlChangedEvent = void(*)( const TArray<FString>& InUrls )

The callback type of favicon url changed.

Parameters
InUrlsThe urls.

◆ FOnFullscreenModeChangedEvent

using UCefView::FOnFullscreenModeChangedEvent = void(*)( bool bInFullscreen )

The callback type of fullscreen mode changed.

Parameters
bInFullscreenThe current fullscreen mode.

◆ FOnInvokeMethodEvent

using UCefView::FOnInvokeMethodEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InMethod , const FString& InArguments )

The callback type of invoking method request from web content(Javascript).

Parameters
InBrowserIdThe browser id.
InFrameIdThe frame id.
InMethodThe method name.
InArgumentsThe arguments list.

◆ FOnLoadEndEvent

using UCefView::FOnLoadEndEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InHttpStatusCode )

The callback type of loading ends.

Parameters
InBrowserIdIndicates the browser id.
InFrameIdIndicates the frame id.
bInIsMainFrameIndicates the whether this is the main frame.
InHttpStatusCodeThe HTTP status code.

◆ FOnLoadErrorEvent

using UCefView::FOnLoadErrorEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InErrorCode , const FString& InErrorMsg , const FString& InFailedUrl )

The callback type of loading failed due to error.

Parameters
InBrowserIdIndicates the browser id.
InFrameIdIndicates the frame id.
bInIsMainFrameIndicates whether this is the main frame.
InErrorCodeThe error code.
InErrorMsgThe error message.
InFailedUrlThe url caused the failure.

◆ FOnLoadingProgressChangedEvent

using UCefView::FOnLoadingProgressChangedEvent = void(*)( double InProgress )

The callback type of loading progress changed.

Parameters
InProgressCurrent progress.

◆ FOnLoadStartEvent

using UCefView::FOnLoadStartEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , bool bInIsMainFrame , int InTransitionType )

The callback type of loading starts.

Parameters
InBrowserIdIndicates the browser id.
InFrameIdIndicates the frame id.
bInIsMainFrameIndicates the whether this is the main frame.
InTransitionTypetransition type.

◆ FOnLoadStateChangedEvent

using UCefView::FOnLoadStateChangedEvent = (*)( const int64& InBrowserId , bool bInIsLoading , bool bInCanGoBack , bool bInCanGoForward )

The callback type of loading state changed.

Parameters
InBrowserIdIndicates the browser id.
bInIsLoadingIndicates the browser is loading.
bInCanGoBackIndicates the browser can go back.
bInCanGoForwardIndicates the browser can go forward.

◆ FOnNativeBrowserCreatedEvent

The callback type of the native browser window created event. This slot does not work for OSR mode.

◆ FOnQueryRequestEvent

using UCefView::FOnQueryRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , UCefViewQuery* InQuery )

The callback type of new UCefQuery request.

Parameters
InBrowserIdThe browser id.
InFrameIdThe frame id.
InQueryThe query request.

◆ FOnReportJavascriptResultEvent

using UCefView::FOnReportJavascriptResultEvent = (*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InContext , const FString& InResult )

The callback type of the result of the javascript executed with executeJavascriptWithResult returned.

Parameters
InBrowserIdThe browser id.
InFrameIdThe frame id.
InContextThe context.
InResultThe result.

◆ FOnStatusMessageEvent

using UCefView::FOnStatusMessageEvent = void(*)( const FString& InMessage )

The callback type of status message changed.

Parameters
InMessageThe status message.

◆ FOnTitleChangedEvent

using UCefView::FOnTitleChangedEvent = void(*)( const FString& InTitle )

The callback type of title changed.

Parameters
InTitleThe title.

◆ FOnUrlRequestEvent

using UCefView::FOnUrlRequestEvent = void(*)( const int64& InBrowserId , const FCefFrameId& InFrameId , const FString& InRequestUrl )

The callback type of built-in scheme URL access.

Parameters
InBrowserIdThe browser id.
InFrameIdThe frame id.
InRequestUrlThe full url.

Constructor & Destructor Documentation

◆ UCefView()

UCefView::UCefView ( )

◆ ~UCefView()

virtual UCefView::~UCefView ( )
virtual

Member Function Documentation

◆ AddArchiveFileResource()

void UCefView::AddArchiveFileResource ( const FString & InArchivePath,
const FString & InTargetUrl,
const FString & InPassword = "",
int32 InPriority = 0 )

Adds a url mapping item with local archive (.zip) file which contains the web resource.

Parameters
InArchivePathThe path to the local archive file.
InTargetUrlThe url to be mapped to.
InPasswordThe password of the archive.
InPriorityThe priority.

◆ AddLocalFolderResource()

void UCefView::AddLocalFolderResource ( const FString & InFolderPath,
const FString & InTargetUrl,
int32 InPriority = 0 )

Adds a url mapping item with local web resource directory.

Parameters
InFolderPathThe path to the local resource directory.
InTargetUrlThe url to be mapped to.
InPriorityThe priority.

◆ BroadcastEvent()

bool UCefView::BroadcastEvent ( const UCefViewEvent * InCefViewEvent)

Broadcasts an event to all frames in the CEF view.

Parameters
InCefViewEventThe event to broadcast.
Returns
True if the event was successfully broadcast; otherwise, false.

◆ BrowserCanGoBack()

bool UCefView::BrowserCanGoBack ( )

Checks whether the browser can go back.

Returns
True if can; otherwise false.

◆ BrowserCanGoForward()

bool UCefView::BrowserCanGoForward ( )

Checks whether the browser can go forward.

Returns
True if can; otherwise false.

◆ BrowserGoBack()

void UCefView::BrowserGoBack ( )

Requires the browser to go back.

◆ BrowserGoForward()

void UCefView::BrowserGoForward ( )

Requires the browser to go forward.

◆ BrowserReload()

void UCefView::BrowserReload ( )

Requires the browser to reload.

◆ BrowserStopLoad()

void UCefView::BrowserStopLoad ( )

Requires the browser to stop load.

◆ CloseDevTools()

void UCefView::CloseDevTools ( )

Closes the dev-tools dialog.

◆ ExecuteJavascript()

bool UCefView::ExecuteJavascript ( const FCefFrameId & InFrameId,
const FString & InJavascriptCode,
const FString & InTargetUrl )

Executes JavaScript code in a specific frame of the CEF view.

Parameters
InFrameIdThe ID of the frame in which to execute the JavaScript.
InJavascriptCodeThe JavaScript code to execute.
InTargetUrlThe URL to associate with the script (used for debugging).
Returns
True if the JavaScript was successfully executed; otherwise, false.

◆ ExecuteJavascriptWithResult()

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.

Parameters
InFrameIdThe ID of the frame in which to execute the JavaScript.
InJavascriptCodeThe JavaScript code to execute.
InTargetUrlThe URL to associate with the script (used for debugging).
InExecuteContextThe context in which the script is executed.
Returns
True if the JavaScript was successfully executed; otherwise, false.

◆ GetBrowserId()

int64 UCefView::GetBrowserId ( )

Gets the browser id.

Returns
The browser id.

◆ HasDevTools()

bool UCefView::HasDevTools ( )

Detects whether this browser has a dev-tools opened.

Returns
True if opend already; otherwise false.

◆ IsBrowserLoading()

bool UCefView::IsBrowserLoading ( )

Checks whether the browser is loading.

Returns
True if it is loading; otherwise false.

◆ IsDragAndDropEnabled()

bool UCefView::IsDragAndDropEnabled ( ) const

Gets whether to enable drag and drop.

Returns
True to enable; otherwise false.

◆ IsPopupContextMenuDisabled()

bool UCefView::IsPopupContextMenuDisabled ( )

Gets whether to disable the context menu for pop-up browser.

Returns
True to disable; otherwise false.

◆ NavigateToUrl()

void UCefView::NavigateToUrl ( const FString & InTargetUrl)

Navigates to the URL.

Parameters
InTargetUrlThe url.

◆ OnNewBrowser()

void UCefView::OnNewBrowser ( const FCefFrameId & InSourceFrameId,
const FString & InUrl,
const FString & InName,
ECefWindowOpenDisposition InTargetDisposition,
FIntRect & InRect )
protected

Gets called before a new browser created (only for browser created by non-JavaScript).

Parameters
InSourceFrameIdThe source frame id.
InUrlThe target URL.
InNameThe target name.
InTargetDispositionTarget window open method.
InRectRect to be used for the popup.

◆ OnNewPopup()

bool UCefView::OnNewPopup ( const FCefFrameId & InFrameId,
const FString & InTargetUrl,
FString & InTargetFrameName,
ECefWindowOpenDisposition InTargetDisposition,
FIntRect & InRect,
FCefViewSettings & InSettings,
bool & bInDisableJavascriptAccess )
protected

Gets called before the pop-up browser is created (only for browsers created by JavaScript).

Parameters
InFrameIdThe source frame ID.
InTargetUrlThe target URL.
InTargetFrameNameThe target name.
InTargetDispositionTarget window open method.
InRectRectangle to be used for the popup.
InSettingsSettings to be used for the popup.
bInDisableJavascriptAccessIndicates whether JavaScript access is disabled.
Returns
True to cancel the popup; false to allow.

◆ OnRequestCloseFromWeb()

bool UCefView::OnRequestCloseFromWeb ( )
protected

Gets called when close request received from the web.

Returns
True to allow the close; false to cancel the close.

◆ OnSlateAddressChangedEvent()

void UCefView::OnSlateAddressChangedEvent ( const FCefFrameId & InFrameId,
const FString & InNewAddress )
protected

Handles the address changed event from the Slate CEF view.

Parameters
InFrameIdThe ID of the frame.
InNewAddressThe new address.

◆ OnSlateConsoleMessageEvent()

void UCefView::OnSlateConsoleMessageEvent ( const FString & InMessage,
int32 InLevel )
protected

Handles the console message event from the Slate CEF view.

Parameters
InMessageThe console message.
InLevelThe level of the console message.

◆ OnSlateDraggableRegionChangedEvent()

void UCefView::OnSlateDraggableRegionChangedEvent ( const FVector4 & InDraggableRegion,
const FVector4 & InNonDraggableRegion )
protected

Handles the draggable region changed event from the Slate CEF view.

Parameters
InDraggableRegionThe draggable region.
InNonDraggableRegionThe non-draggable region.

◆ OnSlateFaviconUrlChangedEvent()

void UCefView::OnSlateFaviconUrlChangedEvent ( const TArray< FString > & InUrls)
protected

Handles the favicon URL changed event from the Slate CEF view.

Parameters
InUrlsThe new favicon URLs.

◆ OnSlateFullscreenModeChangedEvent()

void UCefView::OnSlateFullscreenModeChangedEvent ( bool bInFullscreen)
protected

Handles the fullscreen mode changed event from the Slate CEF view.

Parameters
bInFullscreenWhether the browser is in fullscreen mode.

◆ OnSlateInvokeMethodEvent()

void UCefView::OnSlateInvokeMethodEvent ( const int64 & InBrowserId,
const FCefFrameId & InFrameId,
const FString & InMethod,
const TArray< TSharedPtr< FJsonValue > > & InArguments )
protected

Handles the invoke method event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
InFrameIdThe ID of the frame.
InMethodThe name of the method to invoke.
InArgumentsThe arguments to pass to the method.

◆ OnSlateLoadEndEvent()

void UCefView::OnSlateLoadEndEvent ( const int64 & InBrowserId,
const FCefFrameId & InFrameId,
bool bInIsMainFrame,
int InHttpStatusCode )
protected

Handles the load end event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
InFrameIdThe ID of the frame.
bInIsMainFrameWhether the frame is the main frame.
InHttpStatusCodeThe HTTP status code.

◆ OnSlateLoadErrorEvent()

void UCefView::OnSlateLoadErrorEvent ( const int64 & InBrowserId,
const FCefFrameId & InFrameId,
bool bInIsMainFrame,
int InErrorCode,
const FString & InErrorMsg,
const FString & InFailedUrl,
bool & bInHandled )
protected

Handles the load error event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
InFrameIdThe ID of the frame.
bInIsMainFrameWhether the frame is the main frame.
InErrorCodeThe error code.
InErrorMsgThe error message.
InFailedUrlThe URL that failed to load.
bInHandledWhether the event was handled.

◆ OnSlateLoadingProgressChangedEvent()

void UCefView::OnSlateLoadingProgressChangedEvent ( double InProgress)
protected

Handles the loading progress changed event from the Slate CEF view.

Parameters
InProgressThe loading progress.

◆ OnSlateLoadStartEvent()

void UCefView::OnSlateLoadStartEvent ( const int64 & InBrowserId,
const FCefFrameId & InFrameId,
bool bInIsMainFrame,
int InTransitionType )
protected

Handles the load start event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
InFrameIdThe ID of the frame.
bInIsMainFrameWhether the frame is the main frame.
InTransitionTypeThe transition type.

◆ OnSlateLoadStateChangedEvent()

void UCefView::OnSlateLoadStateChangedEvent ( const int64 & InBrowserId,
bool bInIsLoading,
bool bInCanGoBack,
bool bInCanGoForward )
protected

Handles the load state changed event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
bInIsLoadingWhether the browser is currently loading.
bInCanGoBackWhether the browser can navigate back.
bInCanGoForwardWhether the browser can navigate forward.

◆ OnSlateNativeBrowserCreatedEvent()

void UCefView::OnSlateNativeBrowserCreatedEvent ( )
protected

Handles the native browser created event from the Slate CEF view.

◆ OnSlateQueryRequestEvent()

void UCefView::OnSlateQueryRequestEvent ( const int64 & InBrowserId,
const FCefFrameId & InFrameId,
const int64 & InQueryId,
const FString & InRequest )
protected

Handles the query request event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
InFrameIdThe ID of the frame.
InQueryIdThe ID of the query.
InRequestThe query request.

◆ OnSlateReportJavascriptResultEvent()

void UCefView::OnSlateReportJavascriptResultEvent ( const int64 & InBrowserId,
const FCefFrameId & InFrameId,
const FString & InContext,
const TSharedPtr< FJsonValue > & InResult )
protected

Handles the report javascript result event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
InFrameIdThe ID of the frame.
InContextThe context of the JavaScript execution.
InResultThe result of the JavaScript execution.

◆ OnSlateStatusMessageEvent()

void UCefView::OnSlateStatusMessageEvent ( const FString & InMessage)
protected

Handles the status message event from the Slate CEF view.

Parameters
InMessageThe status message.

◆ OnSlateTitleChangedEvent()

void UCefView::OnSlateTitleChangedEvent ( const FString & InTitle)
protected

Handles the title changed event from the Slate CEF view.

Parameters
InTitleThe new title.

◆ OnSlateUrlRequestEvent()

void UCefView::OnSlateUrlRequestEvent ( const int64 & InBrowserId,
const FCefFrameId & InFrameId,
const FString & InRequestUrl )
protected

Handles the URL request event from the Slate CEF view.

Parameters
InBrowserIdThe ID of the browser.
InFrameIdThe ID of the frame.
InRequestUrlThe requested URL.

◆ RebuildWidget()

virtual TSharedRef< SWidget > UCefView::RebuildWidget ( )
overrideprotectedvirtual

◆ ReleaseSlateResources()

virtual void UCefView::ReleaseSlateResources ( bool bInReleaseChildren)
overridevirtual

◆ ResponseUCefQuery()

bool UCefView::ResponseUCefQuery ( const UCefViewQuery * InCefQuery)

Responses to a CEF query with the provided result.

Parameters
InCefQueryThe CEF query to respond to.
Returns
True if the query was successfully responded to; otherwise, false.

◆ SetDisablePopupContextMenu()

void UCefView::SetDisablePopupContextMenu ( bool bInIsDisable)

Sets whether to disable the context menu for pop-up browser.

Parameters
bInIsDisableTrue to disable; otherwise false.

◆ SetEnableDragAndDrop()

void UCefView::SetEnableDragAndDrop ( bool bInIsEnable)

Sets whether to enable drag and drop.

Parameters
bInIsEnableTrue to enable; otherwise false.

This function does not work for OSR mode. There is a problem, when dragging a file to a non dragging area, the content of the file will be displayed. You need to solve the problem yourself.

◆ SetPreference()

bool UCefView::SetPreference ( const FString & InPreferenceName,
const FString & InPreferenceValue,
FString & InError )

Sets a preference in the CEF browser.

Parameters
InPreferenceNameThe name of the preference to set.
InPreferenceValueThe value to set the preference to.
InErrorAn output parameter that will contain an error message if the preference could not be set.
Returns
True if the preference was successfully set; otherwise, false.

◆ ShowDevTools()

void UCefView::ShowDevTools ( )

Opens the dev-tools dialog.

◆ SynchronizeProperties()

virtual void UCefView::SynchronizeProperties ( )
overridevirtual

◆ TriggerEventForFrame()

bool UCefView::TriggerEventForFrame ( const UCefViewEvent * InCefViewEvent,
const FCefFrameId & InFrameId )

Triggers an event for a specific frame in the CEF view.

Parameters
InCefViewEventThe event to trigger.
InFrameIdThe ID of the frame to trigger the event on.
Returns
True if the event was successfully triggered; otherwise, false.

◆ TriggerEventForMainFrame()

bool UCefView::TriggerEventForMainFrame ( const UCefViewEvent * InCefViewEvent)

Triggers an event for the main frame in the CEF view.

Parameters
InCefViewEventThe event to trigger.
Returns
True if the event was successfully triggered; otherwise, false.

Member Data Documentation

◆ AcceptLanguageList

FString UCefView::AcceptLanguageList

The accept language list for the CEF browser.

◆ AllFrameID

const FCefFrameId UCefView::AllFrameID
static

The identifier for all frames.

◆ AllowJavascriptAccessClipboard

ECefViewFeatureState UCefView::AllowJavascriptAccessClipboard = ECefViewFeatureState::Default

Whether JavaScript can access the clipboard in the CEF browser.

◆ AllowJavascriptCloseWindows

ECefViewFeatureState UCefView::AllowJavascriptCloseWindows = ECefViewFeatureState::Default

Whether JavaScript can close windows in the CEF browser.

◆ AllowJavascriptDomPaste

ECefViewFeatureState UCefView::AllowJavascriptDomPaste = ECefViewFeatureState::Default

Whether JavaScript can paste from the DOM in the CEF browser.

◆ ArchiveFileResourceMapping

TArray<FArchiveFileResourceMapping> UCefView::ArchiveFileResourceMapping

Mappings for archive files to be used as web resources.

◆ BackgroundColor

FColor UCefView::BackgroundColor = FColor::White

The background color of the CEF browser.

◆ CursiveFontFamily

FString UCefView::CursiveFontFamily

The cursive font family for the CEF browser.

◆ Databases

Whether databases are enabled for the CEF browser.

◆ DefaultEncoding

FString UCefView::DefaultEncoding

The default encoding for the CEF browser.

◆ DefaultFixedFontSize

int32 UCefView::DefaultFixedFontSize

The default fixed font size for the CEF browser.

◆ DefaultFontSize

int32 UCefView::DefaultFontSize

The default font size for the CEF browser.

◆ EnableContextMenu

bool UCefView::EnableContextMenu = true

Enables or disables the context menu in the CEF browser.

◆ EnableDragAndDrop

bool UCefView::EnableDragAndDrop = false

Enables or disables drag and drop functionality in the CEF browser.

◆ FantasyFontFamily

FString UCefView::FantasyFontFamily

The fantasy font family for the CEF browser.

◆ FixedFontFamily

FString UCefView::FixedFontFamily

The fixed font family for the CEF browser.

◆ FrameRate

int32 UCefView::FrameRate = 60

The frame rate at which the CEF browser will render.

◆ ImageLoading

Whether images are loading for the CEF browser.

◆ ImageShrinkStandaloneToFit

ECefViewFeatureState UCefView::ImageShrinkStandaloneToFit = ECefViewFeatureState::Default

Whether images shrink standalone to fit for the CEF browser.

◆ Javascript

Whether JavaScript is enabled for the CEF browser.

◆ LocalFolderResroucesMapping

TArray<FLocalFolderResourceMapping> UCefView::LocalFolderResroucesMapping

Mappings for local folders to be used as web resources.

◆ LocalStorage

Whether local storage is enabled for the CEF browser.

◆ MainFrameID

const FCefFrameId UCefView::MainFrameID
static

The main frame identity.

◆ MinimumFontSize

int32 UCefView::MinimumFontSize

The minimum font size for the CEF browser.

◆ MinimumLogicalFontSize

int32 UCefView::MinimumLogicalFontSize

The minimum logical font size for the CEF browser.

◆ OnAddressChanged

FOnAddressChangedEvent UCefView::OnAddressChanged

◆ OnConsoleMessage

FOnConsoleMessageEvent UCefView::OnConsoleMessage

◆ OnDraggableRegionChanged

FOnDraggableRegionChangedEvent UCefView::OnDraggableRegionChanged

◆ OnFaviconUrlChanged

FOnFaviconUrlChangedEvent UCefView::OnFaviconUrlChanged

◆ OnFullscreenModeChanged

FOnFullscreenModeChangedEvent UCefView::OnFullscreenModeChanged

◆ OnInvokeMethod

FOnInvokeMethodEvent UCefView::OnInvokeMethod

◆ OnLoadEnd

FOnLoadEndEvent UCefView::OnLoadEnd

◆ OnLoadError

FOnLoadErrorEvent UCefView::OnLoadError

◆ OnLoadingProgressChanged

FOnLoadingProgressChangedEvent UCefView::OnLoadingProgressChanged

◆ OnLoadStart

FOnLoadStartEvent UCefView::OnLoadStart

◆ OnLoadStateChanged

FOnLoadStateChangedEvent UCefView::OnLoadStateChanged

◆ OnNativeBrowserCreated

FOnNativeBrowserCreatedEvent UCefView::OnNativeBrowserCreated

◆ OnQueryRequest

FOnQueryRequestEvent UCefView::OnQueryRequest

◆ OnReportJavascriptResult

FOnReportJavascriptResultEvent UCefView::OnReportJavascriptResult

◆ OnStatusMessage

FOnStatusMessageEvent UCefView::OnStatusMessage

◆ OnTitleChanged

FOnTitleChangedEvent UCefView::OnTitleChanged

◆ OnUrlRequest

FOnUrlRequestEvent UCefView::OnUrlRequest

◆ Plugins

Whether plugins are enabled for the CEF browser.

◆ RemoteFonts

ECefViewFeatureState UCefView::RemoteFonts

Whether remote fonts are enabled for the CEF browser.

◆ SansSerifFontFamily

FString UCefView::SansSerifFontFamily

The sans-serif font family for the CEF browser.

◆ SerifFontFamily

FString UCefView::SerifFontFamily

The serif font family for the CEF browser.

◆ SlateCefView

TSharedPtr<SCefView> UCefView::SlateCefView
protected

◆ StandardFontFamily

FString UCefView::StandardFontFamily

The standard font family for the CEF browser.

◆ TabToLinks

Whether tabs can be used to navigate links for the CEF browser.

◆ TextAreaResize

Whether text areas can be resized for the CEF browser.

◆ Url

FString UCefView::Url

The URL to be loaded in the CEF browser.

◆ WebGL

Whether WebGL is enabled for the CEF browser.