You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/widgets/webview.mdx
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ The WebView Widget enables seamless integration of web content within native app
19
19
| headerOverrideRules | array | Rules for overriding headers based on URL patterns. See [Header Override Rules](#header-override-rules) for details. |
20
20
| cookies | array | Array of cookie objects for native applications. See [Cookies](#cookies) for details. |
21
21
| cookieHeader | string | Direct set-cookie header string for native applications. |
22
+
| javascriptChannels | array | Define named JavaScript channels to receive messages from the loaded page. See [JavaScript Channels](#javascript-channels) for details. |
22
23
| styles | object |[See properties](#styles)|
23
24
| allowedLaunchSchemes | array of strings | Only available on iOS and Android native apps. Will not have any affect on the web. Optionally specify array of url schemes such as 'tel:', 'mailto:', 'geo:' that when tapped should launch the apps corresponding to the scheme in the system the app is running in.. See below for more details for this property. URL schemes such as http and https are included by default and cannot be overwritten. |
24
25
@@ -55,6 +56,53 @@ For example - if you are displaying messages inside your webview and want the us
55
56
56
57
In order to add additional schemes to the default schemes, specify the default schemes and the additional schemes as an array value of allowedLaunchSchemes. URL schemes such as http and https are included by default and cannot be overwritten.
57
58
59
+
## JavaScript Channels
60
+
61
+
Use `javascriptChannels` to receive messages sent from the page loaded in the WebView. Each channel has a `name` and an `onMessageReceived` handler. Messages arrive as strings in `event.data.message`.
The `headerOverrideRules` property allows you to specify different headers for different URLs based on patterns. This is useful when you need to apply different headers for different domains or API endpoints. Each rule consists of:
0 commit comments