WebKit on Hera
Embed web content in a native Hera interface with the hera-webkit package and its WPEPlatform bridge.
hera-webkit connects WPEWebKit to Hera Kit so an application can place a web page alongside native Rust controls. WebKit produces offscreen page content, while Hera imports that content as an image and composes it into the server-owned display scene. This lets a browser or another embedding use the web engine without handing it the output device or presentation loop.
The repository's browser application demonstrates the complete integration, including a native toolbar, navigation, input, resizing, and frame ownership. The reusable package supplies the WebKit handle and view primitive; the application host supplies the transport and event loop that make them progress together.
Component Responsibilities
WebKit owns HTML, CSS, JavaScript, page layout, and rasterization into its offscreen buffers. Hera retains the image node that refers to the exported page, combines it with native controls and other surfaces, and controls the final Vulkan/DRM presentation. WebKit's rendering context therefore produces application content within Hera's composition rather than taking over scanout.
The native bridge uses a Hera-specific WPEPlatform adapter backed by WPE's headless platform. That backing provides render-node and EGL infrastructure, while the Hera host handles window geometry and routes input from the server. The integration does not require a desktop Wayland composer or a fork of the WebKit source tree.
Learning Paths
Begin with getting started to build the supplied browser and its native bridge. If you are adding web content to another application, continue with using the package, the WebView reference, and custom hosting.
Before implementing your own host, read frame ownership and pacing. It explains why a WebKit frame callback waits for Hera's matching submission acknowledgment while its backing remains retained until a separate release notification. The input guide then follows pointer and keyboard traffic back into the DOM.
Contributors can start with internals and follow the platform, export, and FFI boundaries from there. Deployment and verification cover the environment needed to exercise the complete system.
Current Scope
The supplied integration supports a single web view with navigation, HTTPS, mouse buttons and motion, keyboard input, wheel scrolling, and viewport resize. Downloads, popup windows, native clipboard integration, IME, touch, and permissions UI remain further platform work. An engine capability does not become an application feature until the host supplies the required lifecycle and user interface.
The bridge currently requires WPEWebKit 2.54 or newer and private native ABI 2. Those requirements belong to the embedding boundary; the Hera connection negotiates the independent wire version through ClientHello::PROTOCOL_VERSION. Use the current source and matched deployment artifacts when checking compatibility.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/webkit/src/lib.rscrates/webkit/native/CMakeLists.txtcrates/webkit/native/platform.cppapps/browser/src/host.rs