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.--
ZoomLevelComponentControls the zoom level of the webview as an f64. 0.0 is the default (100%) zoom. Positive values zoom in, negative values zoom out.--
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.--

Resources

NameTypeDescriptionRelated Guide
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, and root_cache_path.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