webview is a small C/C++ library that embeds HTML5 UI in native desktop apps on Linux, macOS, and Windows. It wraps WebKit or Edge WebView2 and supports two-way JavaScript bindings.
Overview
webview helps developers build cross-platform desktop graphical interfaces that render HTML, CSS, and JavaScript inside a native window. The project aims to provide a shared HTML5 UI layer across widely used desktop operating systems.
On Linux it can use GTK with WebKitGTK; on macOS it uses Cocoa WebKit; on Windows it uses the Win32 Edge WebView2 backend. The library is intentionally compact and ships as headers, static libraries, shared libraries, and optional amalgamated builds through CMake targets.
Two-way bindings let C or C++ code invoke JavaScript and let JavaScript call back into native code. Helpers such as dispatch and resolve schedule work on the GUI thread for safer multi-threaded programs. The main thread is expected to run the library event loop.
Because the embedded control is a browser engine rather than a full browser, some web APIs such as alert, confirm, prompt, and console logging are not supported by design. Community bindings exist for many languages, and the core remains a linkable native library.
Key features
- GTK WebKitGTK on Linux
- Cocoa WebKit on macOS
- Edge WebView2 on Windows
- Two-way JavaScript bindings
- CMake static and shared builds
- GUI-thread dispatch helpers
- Optional amalgamated distribution
- C and C++ APIs
Use cases
- HTML5 desktop utilities
- Cross-platform native shells
- Hybrid native and web UI
- Lightweight internal tools