Skip to main content

Components & Events

This page lists all public components, events, and resources provided by bevy_cef.

Components​

NameTypeDescriptionRelated Guide
WebviewSourceComponentSpecifies the content to render: a remote URL, local file, or inline HTML. Constructed via WebviewSource::new(), WebviewSource::local(), or WebviewSource::inline().Your First Webview
WebviewSizeComponentPixel resolution of the rendered webview texture. Default is 800x800. Controls the CSS viewport size, not the 3D mesh dimensions.Your First Webview
WebviewExtendStandardMaterialMaterialMaterial for rendering webview textures on 3D meshes. Extends Bevy's StandardMaterial with webview texture support. Used via MeshMaterial3d<WebviewExtendStandardMaterial>.Your First Webview
HostWindowComponentAssociates a webview with a specific window entity. Defaults to PrimaryWindow if not provided.--
ZoomLevelComponentA request for the zoom level of the webview as an f64, applied at the first main-frame commit. 0.0 is the default (100%) zoom. Positive values zoom in, negative values zoom out. In a profile it is shared per site and remembered.Zoom & Audio
WebviewProfileComponentGives the webview a named, disk-backed profile. Built with WebviewProfile::new(name), which validates the name. Read once, when the webview's browser is requested (when its URL is first resolved); changing or adding it later has no effect.Profiles
AudioMutedComponentControls whether audio is muted for the webview. A bool value.--
PreloadScriptsComponentA Vec<String> of JavaScript code that executes before the page's own scripts load. Useful for injecting polyfills or configuration.--

EntityEvents​

NameTypeDescriptionRelated Guide
Receive<T>EntityEventFired on a webview entity when JavaScript calls window.cef.emit(). T must implement Deserialize. Requires JsEmitEventPlugin::<T> to be registered.Talking to Your Webview
HostEmitEventEntityEventSends data from Bevy to a webview's JavaScript. Constructed via HostEmitEvent::new(webview, event_name, &data). The webview field specifies the target entity.Sending Events to Webview
RequestGoBackEntityEventNavigates the target webview to the previous page in its history. Has a webview: Entity field.Navigation
RequestGoForwardEntityEventNavigates the target webview to the next page in its history. Has a webview: Entity field.Navigation
RequestShowDevToolEntityEventOpens Chrome DevTools for the target webview. Has a webview: Entity field.--
RequestCloseDevtoolEntityEventCloses Chrome DevTools for the target webview. Has a webview: Entity field.--
WebviewProfileErrorEntityEventFired on a webview with a WebviewProfile that gets no browser. Has webview: Entity and a reason: WebviewProfileErrorReason (InvalidName, NoRoot, Directory, DidNotLoad, ContextCreation, BrowserCreation).Profiles

Resources​

NameTypeDescriptionRelated Guide
CefStatusResourceRunning when CEF started, or Failed(CefStartupError) when it did not. CefStartupError::is_root_in_use() tells whether another process holds the cache root.Plugin Configuration
BrowsersNonSend ResourceManages all active CEF browser instances. Used internally by bevy_cef's systems. Not typically accessed directly.Concepts

Plugins​

NameDescriptionRelated Guide
CefPluginRoot plugin that includes all bevy_cef functionality. Accepts CommandLineConfig, CefExtensions, root_cache_path, and cookie_flush_interval.Plugin Configuration
JsEmitEventPlugin<T>Registers a JS Emit event type. Must be added for each T you want to receive via Receive<T>.Talking to Your Webview