![]() |
UCefView 1.0.21
Install On Fab
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.
|
UCefView provides robust interoperability between the native Unreal Engine context (C++/Blueprint) and the web context (JavaScript). This allows you to call JavaScript from C++ and vice-versa, enabling the creation of powerful hybrid applications.
To facilitate communication, UCefView automatically injects a bridge object into the window object of the web context. This object provides the primary interface for web pages to interact with your Unreal application.
The name of this bridge object can be configured in your project's Cef Settings via the BridgeObjectName field. The default name is UCefViewBridge.
| Method | Description |
|---|---|
addEventListener(eventName, listener) | Adds a listener function to be called when a specific event is triggered from C++. |
removeEventListener(eventName, listener) | Removes a previously registered event listener. |
invoke(methodName, ...args) | Invokes a native C++/Blueprint handler with the specified name and arguments. |
You can execute arbitrary JavaScript code within the context of the WebView from C++.
UCefView::ExecuteJavascriptUCefView::ExecuteJavascriptWithResultSCefView::ExecuteJavascriptSCefView::ExecuteJavascriptWithResultYou can register an event from javascript code and then trigger the event from C++ code or Blueprint.
Register event handler in Javascript
Trigger the event from C++ or Blueprint
UCefView::TriggerEventForFrameUCefView::TriggerEventForMainFrameUCefView::BroadcastEventSCefView::TriggerEventForFrameSCefView::TriggerEventForMainFrameSCefView::BroadcastEventYou can register an invoke handler from C++/Blueprint and then invoke the handler from Javascript.
Register invoke handler in C++/Blueprint
Invoke native handler from Javascript
you can register CefViewQuery handler to process the CefViewQuery request and reply with your response.
Register CefViewQuery handler in C++/Blueprint
Send CefViewQuery request from Javascript and process the response