WebView
The WebView widget embeds a web browser area inside an app screen to display web pages and HTML content.
It loads a URL, an in-app asset path, or inline HTML data, and it passes data back and forth between the page and the app.
Definition and role
The WebView widget renders the content you specify in an embedded browser. The widget's type decides how that content is read — as a URL, an asset path, or inline HTML data. Set scrollbar visibility, loading bar visibility, a custom User-Agent, and scroll forwarding to the parent (macOS). From a script, run the page's JavaScript or exchange data with the page.
- Category: Contents
- Default type:
url - Default size (Sized Box): 100 x 100
Features
| Feature | Description |
|---|---|
| Load content | Loads a URL, an app asset path, or inline HTML depending on the type (url, assetpath, or data). |
| Page load notification | Reports the end of page loading through the onFinished event. |
| Page-to-app communication | Receives messages the page sends over the hybrid:// bridge through onShouldOverrideUrl and onReceiveData, and sends data to the page with sendDataToWeb. |
| JavaScript execution | Runs JavaScript inside the page with runJavaScript and asyncRunJavaScript. |
| Display settings | Sets the vertical and horizontal scrollbars, loading bar visibility, and a custom User-Agent. |
How to use
- Open the Contents category in the left widget palette.
- Drag and drop the WebView item onto the canvas.
- In the Properties panel on the right, select a
type(url, assetpath, or data) and enter the address, path, or HTML to load invalue. - Adjust the scrollbars (
verticalScrollBarEnabled,horizontalScrollBarEnabled), the loading bar (showLoadingBar), the User-Agent (userAgent), and other settings as needed.
Properties
| Property | Description | Default | Value / Type |
|---|---|---|---|
type | How value is read | url | url, assetpath, data |
value | The content to load — a URL, asset path, or HTML, depending on the type | Empty | String |
userAgent | A custom User-Agent appended after the default one | Empty | String |
verticalScrollBarEnabled | Whether the vertical scrollbar appears | true | Boolean |
horizontalScrollBarEnabled | Whether the horizontal scrollbar appears | true | Boolean |
embedInParentScroll | Forwards trackpad and mouse wheel scrolling to the parent scroll view (macOS only; ignored on other platforms) | false | Boolean |
showLoadingBar | Whether a loading bar appears while the page loads | true | Boolean |
Notes and tips
When value is empty, no content loads. Enter the URL, asset path, or HTML string exactly as the type requires.
embedInParentScroll works on macOS only. Turn it on when you place a WebView inside a scroll view so trackpad and wheel scrolling reaches the parent — other platforms ignore it.
Learn more
For the full set of Widget Controls (Property, Method, and Event) that script this widget, see WebView Widget Control.