UCefView 1.0.10 Install On Fab Fab logo
World's highest-performance WebView plugin for Unreal Engine. UCefView delivers GPU-accelerated rendering, seamless cross-platform integration and both C++ code and Blueprint development approaches.
Loading...
Searching...
No Matches
UCefViewEvent

Represents an event dispatched from the C++ code in native context to the Javascript code in web context. More...

#include <CefViewEvent.h>

Public Member Functions

FString GetArguments () const
 Gets the arguments associated with this event in JSON string format to be passed to the JavaScript event handler.
 
void SetArguments (const FString &InArguments)
 Sets the arguments for this event using a JSON string.
 

Public Attributes

FString Name
 The name of the event as dispatched from the browser.
 
TArray< TSharedPtr< FJsonValue > > Arguments
 The parsed arguments associated with the event, represented as an array of JSON values.
 

Detailed Description

Represents an event dispatched from the C++ code in native context to the Javascript code in web context.

UCefViewEvent encapsulates the name and arguments of an event sent from JavaScript running in a CEF browser instance to the Unreal Engine application. This enables seamless communication between web content and native game logic, allowing you to handle browser-originated events in both Blueprints and C++.

Events are typically triggered from C++ code and handled in JavaScript code. Trigger events with the following methods:

Member Function Documentation

◆ GetArguments()

FString UCefViewEvent::GetArguments ( ) const

Gets the arguments associated with this event in JSON string format to be passed to the JavaScript event handler.

Returns
A string representing the arguments as a JSON array (e.g., [1, "foo", true]).

◆ SetArguments()

void UCefViewEvent::SetArguments ( const FString & InArguments)

Sets the arguments for this event using a JSON string.

Parameters
InArgumentsA string representing the arguments as a JSON array (e.g., [1, "foo", true]).

Use this method to set the raw arguments as sent to the browser. This method parses the provided JSON string and updates the Arguments property accordingly. The input must be a valid JSON array; otherwise, parsing will fail and the arguments will not be updated.

Member Data Documentation

◆ Arguments

TArray<TSharedPtr<FJsonValue> > UCefViewEvent::Arguments

The parsed arguments associated with the event, represented as an array of JSON values.

Each element in the array corresponds to an argument passed from the browser, and can be a number, string, boolean, object, or array, depending on the data sent from JavaScript.

This property is automatically updated when SetArguments is called, and is used internally by GetArguments to serialize the arguments back to a JSON string.

Use this property for type-safe access to individual arguments in C++.

◆ Name

FString UCefViewEvent::Name

The name of the event as dispatched from the browser.

This string identifies the type or purpose of the event (e.g., "OnButtonClick", "DataReceived"). It is set by the C++ code or blueprint in native context and read by JavaScript.