WebviewJS on Linux renders through WebKitGTK 4.1, a GTK-integrated build of WebKit that ships as a system package on all major distributions. Before running or building WebviewJS you must install both the WebKitGTK library andDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/webviewjs/webview/llms.txt
Use this file to discover all available pages before exploring further.
libxdo, which is used for window-management helpers. The library supports both the X11 and Wayland display servers through Tao, selecting the active backend at runtime based on the environment.
Installing Dependencies
Install the required system packages before using WebviewJS on Linux. The package names vary by distribution:libxdo (xdotool on Arch) provides the X11 window-management utilities that WebviewJS uses internally. It is required even on Wayland sessions.Display Server Support
WebviewJS supports both X11 and Wayland through Tao. The backend is selected automatically at startup from theDISPLAY and WAYLAND_DISPLAY environment variables — no code changes or feature flags are required.
X11
Full window positioning, absolute placement, and system-tray support. The classic, well-tested path.
Wayland
Supported via XDG Shell. Client-side decorations are drawn by
adwaita CSD. Some compositor-specific constraints apply.Wayland-Specific Notes
Key differences when running on Wayland:- Window decorations are drawn client-side via the
adwaitaCSD theme. - Screen capture and content-protection APIs are compositor-dependent (no universal Wayland equivalent of Win32
SetWindowDisplayAffinity). - The Wayland surface pointer is exposed for native interoperability (see below).
Getting the Wayland Surface
getWaylandSurface() returns Tao’s native wl_surface pointer as a BigInt, or 0n when the window is running under X11:
Menus
Native menu bars use Muda’s GTK integration. WebviewJS retrieves the GTK window and default vertical box directly from Tao, soapp.setMenu(), per-window menu options, and CustomMenuClick events all work on Linux:
Menu behaviour is subject to the active GTK theme and desktop environment. Some compositors or minimal WMs may render menus differently from GNOME/KDE defaults.
Skip Taskbar
Automation Support
WebContext.setAllowsAutomation() enables WebDriver / automation mode on a WebKit context. This flag is only enforced on Linux and has the constraint that only one context at a time may have automation enabled:
Tested Environments
| Distribution | Display server | Status |
|---|---|---|
| Ubuntu 22.04 | X11 / Wayland | Supported |
| Fedora 40 | Wayland (GNOME) | Supported |
| Arch Linux | X11 / Wayland | Supported |
| Debian 12 | X11 | Supported |