PureBasic - WebView

Overview

The WebView library is a modern web browser gadget which can be used to easily create HTML/CSS UI in PureBasic. It allows to have rich cross-platform UI which behaves and looks the same, while having access to advanced CSS functions to enhance the user experience. The component is directly embedded in the PureBasic program for minimal footprint and using native callbacks to interact between the web content (which is JavaScript) and the PureBasic code.

The WebView gadget is leveraging the built-in OS web components (WebView2 on Windows, WebKit-GTK on Linux/Raspberry and WebKit on macOS). On Windows 10 and above, no additional component is required but if older Windows support is needed, the WebView2 redistributable might need to be installed: distribution guide.

As the WebView component is a PureBasic gadget library, standard commands like ResizeGadget() or HideGadget() can be used to control it.

Command Index

BindWebViewCallback
UnbindWebViewCallback
WebViewExecuteScript
WebViewGadget
WebViewProxy

Example

WebView.pb

Supported OS

All

Reference Manual - Index