Zebkit: Embedding Chromium as a Lightweight Library
A new library allows developers to integrate Chromium's engine directly into applications without Electron.
1Core Engine Integration
Zebkit functions as an embeddable library that integrates Chromium's core components, including the Blink rendering engine and V8 JavaScript engine, directly into custom applications. Unlike Electron, which requires a full browser runtime, Zebkit allows developers to link these components as a native library, maintaining complete control over the application's main process.
2Multi-Language Support
The library provides native bindings for C, C++, Rust, Python, and JavaScript, enabling developers to use their preferred language. Applications can call Zebkit APIs to handle web views, PDF rendering, media processing, and cryptographic functions. This flexibility ensures that developers can maintain their own toolkit and window management systems while utilizing Chromium.
3PDF and Media Processing
Zebkit includes built-in capabilities for PDF manipulation, image encoding, and media handling through integrated libraries like PDFium and FFmpeg. Developers can render PDF pages to images or extract text directly using Zebkit's API. These services operate within the library, eliminating the need for external dependencies or separate installations for these specific tasks.
4Flexible Execution Models
The engine supports two primary execution models: running the engine's main loop or integrating it into an existing application loop. For applications using frameworks like GTK, Qt, or AppKit, developers can call zebkit_init and zebkit_pump to maintain compatibility. This allows the engine to coexist with native UI frameworks without conflicts.
5Security and Sandboxing
On Windows, Zebkit leverages Chromium's sandbox architecture by linking against zebkit_sandbox.lib. The engine requires unprivileged user namespaces to start, ensuring that web-based content remains isolated from the host system. Developers must explicitly grant permissions for web pages to access specific application functions, maintaining a secure boundary between the web view and host.
6Custom Scheme Handling
Developers can register custom URI schemes, such as app://, to serve local files or internal application resources securely. By using zebkit_scheme_handle, applications control exactly which files are accessible to the web view. This mechanism prevents unauthorized access to the filesystem while allowing the application to serve its own UI components.
7Desktop System Integration
Zebkit provides deep integration with desktop environments, including support for system tray icons, badges, and native menu bars on macOS. It allows applications to respond to system events like dark mode changes, power status updates, and screen locks. These features ensure that embedded web content feels like a native desktop application.
8Native UI and Styling
The library supports native window controls, including custom title bars and drag regions defined via CSS. Developers can use Zebkit's UI components to build interfaces that look and feel native. For JavaScript-based applications, it supports modern styling frameworks like Tailwind, allowing for rapid development of responsive and visually consistent application interfaces.
9Automation and Testing
Zebkit includes built-in support for automation protocols, allowing developers to run Playwright-style commands directly within the application process. This eliminates the need for external CDP connections or Node.js runtimes during testing. Automation calls can be executed via C or Python bindings, simplifying the process of testing complex web-based UI interactions.
10Deployment and Packaging
The engine is distributed as a package containing the library, headers, and necessary data files. Developers can download pre-built releases from GitHub or build the engine locally using provided scripts. The build process requires significant disk space for the Chromium source tree, but results in a standalone library ready for linking.
11Rust and Python Integration
For Rust developers, Zebkit is available via crates.io, with a build-dependency that handles engine downloading and verification. Python developers can install the binding via pip and point the ZEBKIT_DIR environment variable to the engine package. Both methods allow for a streamlined development experience without requiring complex compilation of the entire engine.
12Architectural Significance
Zebkit represents a shift toward modularizing browser engines for desktop software development. By stripping away the browser shell, it offers a high-performance alternative for developers who need web rendering capabilities without the overhead of Electron. This approach prioritizes application autonomy, security, and native system integration for modern cross-platform software projects.
Original article: Hacker News — Zebkit: Embedding Chromium as a Lightweight Library