Minimal Haskell bindings for the official webview C API. The library builds the
upstream core/src/webview.cc translation unit directly and exposes a tiny API
around window creation, lifecycle management, navigation and HTML rendering.
- Build is driven by Nix, so you only need a working Nix installation.
- The flake automatically vendors the upstream
webview/coresources intocbits/via thewebviewflake input, so the project can live outside of the upstream repository. - The flake pulls in GTK/WebKit dependencies on Linux and Cocoa/WebKit frameworks on macOS automatically.
cd hs-webview
nix develop
cabal run democabal run demo compiles the library and launches the sample program in
app/Main.hs, which opens a WebView window rendering inline HTML.
Whenever you need to refresh the embedded core/src/webview.cc + headers, run
the helper app:
nix run .#sync-webviewThe development shell also keeps cbits/ populated automatically. This is the
same mechanism that callCabal2nix uses during Nix builds, ensuring the
packaged tarball always contains the correct C sources.
- Expand the Haskell API surface as needed (callbacks, dispatch, bindings to more of the C API)
- Add CI builds for Linux and macOS using the provided flake outputs
- Publish the package to Hackage once the API stabilises