1# Interfaces (Others) 2 3> **NOTE** 4> 5> - This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. 6> 7> - You can preview how this component looks on a real device, but not in DevEco Studio Previewer. 8 9## WebOptions 10 11Defines web options through the [APIs](./arkts-basic-components-web.md). 12 13**System capability**: SystemCapability.Web.Webview.Core 14 15| Name | Type | Mandatory | Description | 16| ---------- | ---------------------------------------- | ---- | ---------------------------------------- | 17| src | string \| [Resource](../apis-arkui/arkui-ts/ts-types.md#resource) | Yes | Address of a web page resource. To access local resource files, use the $rawfile or resource protocol. To load a local resource file (in HTML or TXT format) in the sandbox outside of the application package, use **file://** to specify the path of the sandbox.<br>**src** cannot be dynamically changed through a state variable (for example, @State). To change the value, call [loadUrl()](./arkts-apis-webview-WebviewController.md#loadurl).| 18| controller | [WebController](./arkts-basic-components-web-WebController.md) \| [WebviewController<sup>9+</sup>](./arkts-basic-components-web-t.md#webviewcontroller9) | Yes | Controller that controls various behaviors of **Web** components, including page navigation, declaration period status, and JavaScript interaction. This API is deprecated since API version 9. You are advised to use **WebviewController** instead.| 19| renderMode<sup>12+</sup> | [RenderMode](./arkts-basic-components-web-e.md#rendermode12)| No | Rendering mode.<br>**RenderMode.ASYNC_RENDER** (default, cannot be dynamically adjusted): The **Web** component is rendered asynchronously.<br>**RenderMode.SYNC_RENDER**: The **Web** component is rendered synchronously within the current execution context.| 20| incognitoMode<sup>11+</sup> | boolean | No| Whether to enable incognito mode. The value **true** means to enable incognito mode, and **false** means the opposite.<br> Default value: **false**.| 21| sharedRenderProcessToken<sup>12+</sup> | string | No| Token of the shared rendering process specified by the **Web** component. In multi-rendering process mode, the **Web** component with the same token preferentially attempts to reuse the rendering process bound to the token. The token is bound to the rendering process when the rendering process is initialized. When the rendering process is not associated with a **Web** component, its binding to the token is removed.<br> Default value: **""**. | 22 23## WebMediaOptions<sup>10+</sup> 24 25Describes the web media options. 26 27**System capability**: SystemCapability.Web.Webview.Core 28 29| Name | Type | Mandatory | Description | 30| -------------- | ------- | ---- | ---------------------------------------- | 31| resumeInterval | number | No | Validity period for automatically resuming a web audio paused by another application, in seconds. The value range is [-2147483648, 2147483647]. If **resumeInterval** is set to **0**, the playback is not automatically resumed. If **resumeInterval** is set to a value greater than 0, the playback is resumed in the specified period. If **resumeInterval** is set to a value less than 0, the playback is resumed in an unlimited period. Due to the approximate value, the validity period may have a deviation of less than 1 second.<br>**NOTE**<br>After an HLS video is interrupted, the video playback is automatically resumed when the video is returned to the foreground.| 32| audioExclusive | boolean | No | Whether the audio of multiple **Web** instances in an application is exclusive.<br>The value **true** indicates that the audio of multiple **Web** instances in an application is exclusive, and **false** indicates the opposite. | 33| audioSessionType<sup>20+</sup> | [AudioSessionType](./arkts-basic-components-web-e.md#audiosessiontype20) | No | Web audio type in the application. The default value is [STREAM_USAGE_MUSIC](../../reference/apis-audio-kit/arkts-apis-audio-e.md#streamusage). This parameter changes the mapping between the component audio type and the system audio type, which affects the ArkWeb audio focus policy.| 34 35## ScriptItem<sup>11+</sup> 36 37Describes the **ScriptItem** object registered with the **Web** component through the [javaScriptOnDocumentStart](./arkts-basic-components-web-attributes.md#javascriptondocumentstart11) attribute. 38 39**System capability**: SystemCapability.Web.Webview.Core 40 41| Name | Type | Mandatory | Description | 42| ----------- | -------------- | ---- | --------------------- | 43| script | string | Yes | JavaScript script to be registered and executed.| 44| scriptRules | Array\<string> | Yes | Matching rules for allowed sources.<br>1. To allow URLs from all sources, use the wildcard (\*).<br>2. If exact match is required, specify the exact URL, for example, **https:\//www\.example.com**.<br>3. For fuzzy match, you can use a wildcard (\*) in the website URL, for example, **https://*.example.com**. Websites such as "x,*.y.com" and "* foobar.com" are not allowed.<br>4. If the source is an IP address, follow rule 2.<br>5. For protocols other than HTTP/HTTPS (custom protocols), exact match and fuzzy match are not supported, and the protocol must end with "://", for example, **resource://**.<br>6. If one of the preceding rules is not met in **scriptRules**, the **scriptRules** does not take effect.| 45 46## NestedScrollOptionsExt<sup>14+</sup> 47 48Implements a **NestedScrollOptionsExt** object to set up, down, left, and right nested scrolling options. 49 50**System capability**: SystemCapability.Web.Webview.Core 51 52| Name | Type | Mandatory | Description | 53| -------------- | ---------------- | ---- | -------------------- | 54| scrollUp | [NestedScrollMode](../apis-arkui/arkui-ts/ts-appendix-enums.md#nestedscrollmode10) | No | Nested scrolling options when the component scrolls up.| 55| scrollDown | [NestedScrollMode](../apis-arkui/arkui-ts/ts-appendix-enums.md#nestedscrollmode10) | No | Nested scrolling options when the component scrolls down.| 56| scrollLeft | [NestedScrollMode](../apis-arkui/arkui-ts/ts-appendix-enums.md#nestedscrollmode10) | No | Nested scrolling options when the component scrolls left.| 57| scrollRight | [NestedScrollMode](../apis-arkui/arkui-ts/ts-appendix-enums.md#nestedscrollmode10) | No | Nested scrolling options when the component scrolls right.| 58 59## NativeMediaPlayerConfig<sup>12+</sup> 60 61Represents the configuration for [enabling the application to take over web page media playback](./arkts-basic-components-web-attributes.md#enablenativemediaplayer12). 62 63**System capability**: SystemCapability.Web.Webview.Core 64 65| Name| Type| Mandatory| Description| 66|------|------|------|------| 67| enable | boolean | Yes| Whether to enable the application to take over web page media playback.<br> The value **true** means to enable the application to take over web page media playback, and **false** means the opposite.<br> Default value: **false**.| 68| shouldOverlay | boolean | Yes| Whether the video player's display overlays the web page content when the application takes over the web page's video player.<br> The value **true** indicates that the video player's display overlays the web page content. This means that the height of the video layer is adjusted to cover the web page content. The value **false** indicates that the video player's display does not overlay the web page content. This means that the video player maintains its original height and is embedded within the web page.<br>Default value: **false**.| 69 70## ExpandedMenuItemOptions<sup>12+</sup> 71 72Represents the custom expanded menu item options. 73 74**System capability**: SystemCapability.Web.Webview.Core 75 76| Name | Type | Mandatory | Description | 77| ---------- | -----------------------------------------------------| ------ | ---------------- | 78| content | [ResourceStr](../apis-arkui/arkui-ts/ts-types.md#resourcestr) | Yes | Display content. | 79| startIcon | [ResourceStr](../apis-arkui/arkui-ts/ts-types.md#resourcestr) | No | Display icon. | 80| action | (selectedText: {plainText: string}) => void | Yes | Selected text.| 81 82## AdsBlockedDetails<sup>12+</sup> 83 84Provides detailed information about the blocked ads when ads are blocked. 85 86**System capability**: SystemCapability.Web.Webview.Core 87 88| Name| Type | Mandatory | Description | 89| ------- | -------------------------------------------------------------------------------- | ---- | ------------------------- | 90| url | string | Yes | URL of the page where ads are blocked.| 91| adsBlocked | Array\<string\> | Yes | URLs or dompaths of the blocked ads. If multiple ads have the same URLs, duplicate elements may exist.| 92 93## SelectionMenuOptionsExt<sup>13+</sup> 94 95Represents the selection menu option extension. 96 97**System capability**: SystemCapability.Web.Webview.Core 98 99| Name | Type | Mandatory | Description | 100| ---------- | -----------------------------------------------------| ------ | ---------------- | 101| onAppear | Callback\<void\> | No | Callback invoked when the custom selection menu appears. | 102| onDisappear | Callback\<void\> | No | Callback invoked when the custom selection menu disappears. | 103| preview | [CustomBuilder](../apis-arkui/arkui-ts/ts-types.md#custombuilder8) | No | Preview content style of the custom selection menu. If this parameter is not set, there is no preview content.| 104| menuType | [MenuType](../apis-arkui/arkui-ts/ts-text-common.md#menutype13) | No | Type of the custom selection menu.<br>Default value: **MenuType.SELECTION_MENU**<br> Since API version 20, **MenuType.PREVIEW_MENU** supports hyperlink preview. | 105| previewMenuOptions<sup>20+</sup> | [PreviewMenuOptions](#previewmenuoptions20) | No | Custom preview menu options.| 106 107## PreviewMenuOptions<sup>20+</sup> 108 109Represents the options of the preview menu. 110 111**System capability**: SystemCapability.Web.Webview.Core 112 113| Name | Type | Mandatory | Description | 114| ---------- | -----------------------------------------------------| ------ | ---------------- | 115| hapticFeedbackMode | [HapticFeedbackMode](../apis-arkui/arkui-ts/ts-universal-attributes-menu.md#hapticfeedbackmode18) | No | Vibration effect when the menu is displayed. The **ohos.permission.VIBRATE** permission is required.<br>Default value: **HapticFeedbackMode.DISABLED**, indicating no vibration when the menu is displayed. | 116 117## EmbedOptions<sup>16+</sup> 118 119Represents the same-layer rendering configuration of the **Web** component. 120 121**System capability**: SystemCapability.Web.Webview.Core 122 123| Name | Type | Mandatory | Description | 124| -------------- | ------- | ---- | ---------------------------------------- | 125| supportDefaultIntrinsicSize | boolean | No | Whether a same-layer rendering element supports the fixed size of 300 × 150.<br>When the size of an element is set using CSS on the HTML5 side, the size of the same-layer rendering element uses the CSS size. Otherwise, the size is fixed.<br>If the value is **true**, the fixed size is 300 × 150.<br>If the value is **false** and the CSS size is not set on the HTML5 side, the same-layer rendering elements are not rendered.<br>Default value: **false**.<br>Unit: px.| 126| supportCssDisplayChange<sup>20+</sup> | boolean | No | Whether the same-layer rendering visibility API supports the display attribute.<br>By default, the visibility status of same-layer tags relative to the viewport is supported.<br>If this attribute is set to **true**, CSS attributes can be displayed, including visibility, display, width, and height.<br>Otherwise, CSS attributes are not displayed, and only same-layer tags are visible relative to the viewport.| 127 128## OnAlertEvent<sup>12+</sup> 129 130Represents the callback invoked when **alert()** is invoked to display an alert dialog box on the web page. 131 132**System capability**: SystemCapability.Web.Webview.Core 133 134| Name | Type | Mandatory | Description | 135| -------------- | ---- | ---- | ---------------------------------------- | 136| url | string | Yes| URL of the web page where the dialog box is displayed. | 137| message | string | Yes| Message displayed in the dialog box. | 138| result | [JsResult](./arkts-basic-components-web-JsResult.md) | Yes| User operation. | 139 140## OnBeforeUnloadEvent<sup>12+</sup> 141 142Represents the callback invoked when this page is about to exit after the user refreshes or closes the page. 143 144**System capability**: SystemCapability.Web.Webview.Core 145 146| Name | Type | Mandatory | Description | 147| -------------- | ---- | ---- | ---------------------------------------- | 148| url | string | Yes| URL of the web page where the dialog box is displayed. | 149| message | string | Yes| Message displayed in the dialog box. | 150| result | [JsResult](./arkts-basic-components-web-JsResult.md) | Yes| User operation. | 151| isReload<sup>20+</sup> | boolean | No| Whether the page is refreshed.<br>The value **true** indicates that the page is about to leave due to refreshing, and **false** indicates that the page is about to leave due to closing.<br>Default value: **false**.| 152 153## OnConfirmEvent<sup>12+</sup> 154 155Represents the callback triggered when **confirm()** is invoked by the web page. 156 157**System capability**: SystemCapability.Web.Webview.Core 158 159| Name | Type | Mandatory | Description | 160| -------------- | ---- | ---- | ---------------------------------------- | 161| url | string | Yes| URL of the web page where the dialog box is displayed. | 162| message | string | Yes| Message displayed in the dialog box. | 163| result | [JsResult](./arkts-basic-components-web-JsResult.md) | Yes| User operation. | 164 165## OnPromptEvent<sup>12+</sup> 166 167Represents the callback triggered when **prompt()** is invoked by the web page. 168 169**System capability**: SystemCapability.Web.Webview.Core 170 171| Name | Type | Mandatory | Description | 172| -------------- | ---- | ---- | ---------------------------------------- | 173| url | string | Yes| URL of the web page where the dialog box is displayed. | 174| message | string | Yes| Message displayed in the dialog box. | 175| value | string | Yes| Information in the dialog box. | 176| result | [JsResult](./arkts-basic-components-web-JsResult.md) | Yes| User operation. | 177 178## OnConsoleEvent<sup>12+</sup> 179 180Represents the callback invoked to notify the host application of a JavaScript console message. 181 182**System capability**: SystemCapability.Web.Webview.Core 183 184| Name | Type | Mandatory | Description | 185| -------------- | ---- | ---- | ---------------------------------------- | 186| message | [ConsoleMessage](./arkts-basic-components-web-ConsoleMessage.md) | Yes| Console message. | 187 188## OnErrorReceiveEvent<sup>12+</sup> 189 190Represents the callback triggered when an error occurs during web page loading. 191 192**System capability**: SystemCapability.Web.Webview.Core 193 194| Name | Type | Mandatory | Description | 195| -------------- | ---- | ---- | ---------------------------------------- | 196| request | [WebResourceRequest](./arkts-basic-components-web-WebResourceRequest.md) | Yes| Encapsulation of a web page request. | 197| error | [WebResourceError](./arkts-basic-components-web-WebResourceError.md) | Yes| Encapsulation of a web page resource loading error.| 198 199## OnHttpErrorReceiveEvent<sup>12+</sup> 200 201Represents the callback triggered when an HTTP error occurs during web page resource loading. 202 203**System capability**: SystemCapability.Web.Webview.Core 204 205| Name | Type | Mandatory | Description | 206| -------------- | ---- | ---- | ---------------------------------------- | 207| request | [WebResourceRequest](./arkts-basic-components-web-WebResourceRequest.md) | Yes| Encapsulation of a web page request. | 208| response | [WebResourceResponse](./arkts-basic-components-web-WebResourceResponse.md) | Yes| Encapsulation of a resource response.| 209 210## OnDownloadStartEvent<sup>12+</sup> 211 212Represents the callback invoked when the host application starts downloading a file. 213 214**System capability**: SystemCapability.Web.Webview.Core 215 216| Name | Type | Mandatory | Description | 217| -------------- | ---- | ---- | ---------------------------------------- | 218| url | string | Yes| URL for the download task. | 219| userAgent | string | Yes| User agent used for download. | 220| contentDisposition | string | Yes| Content-Disposition response header returned by the server, which may be empty.| 221| mimetype | string | Yes| MIME type of the content returned by the server. | 222| contentLength | number | Yes| Length of the content returned by the server. | 223 224## OnRefreshAccessedHistoryEvent<sup>12+</sup> 225 226Represents the callback invoked when the access history of the web page is refreshed. 227 228**System capability**: SystemCapability.Web.Webview.Core 229 230| Name | Type | Mandatory | Description | 231| -------------- | ---- | ---- | ---------------------------------------- | 232| url | string | Yes| URL to be accessed. | 233| isRefreshed | boolean | Yes| Whether the page is reloaded. The value **true** means that the page is reloaded by invoking the [refresh<sup>9+</sup>](./arkts-apis-webview-WebviewController.md#refresh) API, and **false** means the opposite.| 234 235## OnRenderExitedEvent<sup>12+</sup> 236 237Represents the callback invoked when the rendering process exits. 238 239**System capability**: SystemCapability.Web.Webview.Core 240 241| Name | Type | Mandatory | Description | 242| -------------- | ---- | ---- | ---------------------------------------- | 243| renderExitReason | [RenderExitReason](./arkts-basic-components-web-e.md#renderexitreason9) | Yes| Cause for the abnormal exit of the rendering process.| 244 245## OnShowFileSelectorEvent<sup>12+</sup> 246 247Represents the callback invoked to notify the file selector result. 248 249**System capability**: SystemCapability.Web.Webview.Core 250 251| Name | Type | Mandatory | Description | 252| -------------- | ---- | ---- | ---------------------------------------- | 253| result | [FileSelectorResult](./arkts-basic-components-web-FileSelectorResult.md) | Yes| File selection result to be sent to the **Web** component.| 254| fileSelector | [FileSelectorParam](./arkts-basic-components-web-FileSelectorParam.md) | Yes| Information about the file selector. | 255 256## OnResourceLoadEvent<sup>12+</sup> 257 258Represents the callback invoked when the URL is loaded. 259 260**System capability**: SystemCapability.Web.Webview.Core 261 262| Name | Type | Mandatory | Description | 263| -------------- | ---- | ---- | ---------------------------------------- | 264| url | string | Yes| URL of the loaded resource file.| 265 266## OnScaleChangeEvent<sup>12+</sup> 267 268Represents the callback invoked when the display scale of this page changes. 269 270**System capability**: SystemCapability.Web.Webview.Core 271 272| Name | Type | Mandatory | Description | 273| -------------- | ---- | ---- | ---------------------------------------- | 274| oldScale | number | Yes| Display scale of the page before the change.| 275| newScale | number | Yes| Display scale of the page after the change.| 276 277## OnHttpAuthRequestEvent<sup>12+</sup> 278 279Represents the callback invoked when an HTTP authentication request is received. 280 281**System capability**: SystemCapability.Web.Webview.Core 282 283| Name | Type | Mandatory | Description | 284| -------------- | ---- | ---- | ---------------------------------------- | 285| handler | [HttpAuthHandler](./arkts-basic-components-web-HttpAuthHandler.md) | Yes| User operation. | 286| host | string | Yes| Host to which the HTTP authentication credential is applied.| 287| realm | string | Yes| Realm to which the HTTP authentication credential is applied. | 288 289## OnInterceptRequestEvent<sup>12+</sup> 290 291Represents the callback invoked when the **Web** component is about to load a URL. 292 293**System capability**: SystemCapability.Web.Webview.Core 294 295| Name | Type | Mandatory | Description | 296| -------------- | ---- | ---- | ---------------------------------------- | 297| request | [WebResourceRequest](./arkts-basic-components-web-WebResourceRequest.md) | Yes| Information about the URL request.| 298 299## OnPermissionRequestEvent<sup>12+</sup> 300 301Represents the callback invoked when a permission request is received. 302 303**System capability**: SystemCapability.Web.Webview.Core 304 305| Name | Type | Mandatory | Description | 306| -------------- | ---- | ---- | ---------------------------------------- | 307| request | [PermissionRequest](./arkts-basic-components-web-PermissionRequest.md) | Yes| User operation.| 308 309## OnScreenCaptureRequestEvent<sup>12+</sup> 310 311Represents the callback invoked when a screen capture request is received. 312 313**System capability**: SystemCapability.Web.Webview.Core 314 315| Name | Type | Mandatory | Description | 316| -------------- | ---- | ---- | ---------------------------------------- | 317| handler | [ScreenCaptureHandler](./arkts-basic-components-web-ScreenCaptureHandler.md) | Yes| User operation.| 318 319## OnContextMenuShowEvent<sup>12+</sup> 320 321Represents the callback invoked during a call to allow for the display of a custom context menu. 322 323**System capability**: SystemCapability.Web.Webview.Core 324 325| Name | Type | Mandatory | Description | 326| -------------- | ---- | ---- | ---------------------------------------- | 327| param | [WebContextMenuParam](./arkts-basic-components-web-WebContextMenuParam.md) | Yes| Parameters related to the context menu. | 328| result | [WebContextMenuResult](./arkts-basic-components-web-WebContextMenuResult.md) | Yes| Result of the context menu.| 329 330## OnSearchResultReceiveEvent<sup>12+</sup> 331 332Represents the callback invoked to notify the caller of the search result on the web page. 333 334**System capability**: SystemCapability.Web.Webview.Core 335 336| Name | Type | Mandatory | Description | 337| -------------- | ---- | ---- | ---------------------------------------- | 338| activeMatchOrdinal | number | Yes| Sequence number of the current match, which starts from 0. | 339| numberOfMatches | number | Yes| Total number of matches. | 340| isDoneCounting | boolean | Yes| Whether the search operation on the current page is complete.<br>The value **true** indicates that the search operation on the current page is complete, and **false** indicates the opposite.<br>This API may be called multiple times until **isDoneCounting** is **true**.| 341 342## OnScrollEvent<sup>12+</sup> 343 344Represents the callback invoked when the scrollbar scrolls to a specified position. 345 346**System capability**: SystemCapability.Web.Webview.Core 347 348| Name | Type | Mandatory | Description | 349| -------------- | ---- | ---- | ---------------------------------------- | 350| xOffset | number | Yes| Position of the scrollbar on the x-axis relative to the leftmost of the web page.<br>Unit: vp.| 351| yOffset | number | Yes| Position of the scrollbar on the y-axis relative to the top of the web page.<br>Unit: vp.| 352 353## OnSslErrorEventReceiveEvent<sup>12+</sup> 354 355Represents the callback invoked when the web page receives an SSL error. 356 357**System capability**: SystemCapability.Web.Webview.Core 358 359| Name | Type | Mandatory | Description | 360| -------------- | ---- | ---- | ---------------------------------------- | 361| handler | [SslErrorHandler](./arkts-basic-components-web-SslErrorHandler.md) | Yes| User operation.| 362| error | [SslError](./arkts-basic-components-web-e.md#sslerror9) | Yes| Error code. | 363| certChainData<sup>15+</sup> | Array<Uint8Array\> | No| Certificate chain data. | 364 365## SslErrorEvent<sup>12+</sup> 366 367Provides details about the callback invoked when an SSL error occurs during resource loading. 368 369**System capability**: SystemCapability.Web.Webview.Core 370 371| Name | Type | Mandatory | Description | 372| ------- | ------------------------------------ | ---- | -------------- | 373| handler | [SslErrorHandler](./arkts-basic-components-web-SslErrorHandler.md) | Yes | User operation.| 374| error | [SslError](./arkts-basic-components-web-e.md#sslerror9) | Yes | Error code. | 375| url | string | Yes | URL. | 376| originalUrl | string | Yes | Original URL of the request. | 377| referrer | string | Yes | Referrer URL. | 378| isFatalError | boolean | Yes | Whether the error is a fatal error.<br>The value **true** indicates a fatal error, and **false** indicates a non-fatal error. | 379| isMainFrame | boolean | Yes | Whether the resource is a main resource.<br>The value **true** indicates a main resource, and **false** indicates a non-main resource. | 380| certChainData<sup>20+</sup> | Array<Uint8Array\> | No| Certificate chain data. | 381 382## OnClientAuthenticationEvent<sup>12+</sup> 383 384Represents the callback invoked when an SSL client certificate is required from the user. 385 386**System capability**: SystemCapability.Web.Webview.Core 387 388| Name | Type | Mandatory | Description | 389| -------------- | ---- | ---- | ---------------------------------------- | 390| handler | [ClientAuthenticationHandler](./arkts-basic-components-web-ClientAuthenticationHandler.md) | Yes| User operation. | 391| host | string | Yes| Host name of the server that requests a certificate. | 392| port | number | Yes| Port number of the server that requests a certificate. | 393| keyTypes | Array<string\> | Yes| Acceptable asymmetric private key types. | 394| issuers | Array<string\> | Yes| Issuer of the certificate that matches the private key.| 395 396## OnWindowNewEvent<sup>12+</sup> 397 398Represents the callback invoked when the web page requests the user to create a window. 399 400**System capability**: SystemCapability.Web.Webview.Core 401 402| Name | Type | Mandatory | Description | 403| -------------- | ---- | ---- | ---------------------------------------- | 404| isAlert | boolean | Yes| Whether to open the target URL in a new window. The value **true** means to open the target URL in a new window, and **false** means to open the target URL in a new tab. | 405| isUserTrigger | boolean | Yes| Whether the creation is triggered by the user. The value **true** means that the creation is triggered by the user, and **false** means the opposite. | 406| targetUrl | string | Yes| Target URL. | 407| handler | [ControllerHandler](./arkts-basic-components-web-ControllerHandler.md) | Yes| **WebviewController** instance for setting the new window.| 408 409## OnTouchIconUrlReceivedEvent<sup>12+</sup> 410 411Represents the callback invoked when an apple-touch-icon URL is received. 412 413**System capability**: SystemCapability.Web.Webview.Core 414 415| Name | Type | Mandatory | Description | 416| -------------- | ---- | ---- | ---------------------------------------- | 417| url | string | Yes| Received apple-touch-icon URL.| 418| precomposed | boolean | Yes| Whether the apple-touch-icon is precomposed.<br>**true** indicates that the apple-touch-icon is precomposed, and **false** indicates the opposite. | 419 420## OnFaviconReceivedEvent<sup>12+</sup> 421 422Represents the callback invoked when this web page receives a new favicon. 423 424**System capability**: SystemCapability.Web.Webview.Core 425 426| Name | Type | Mandatory | Description | 427| -------------- | ---- | ---- | ---------------------------------------- | 428| favicon | [PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) | Yes| **PixelMap** object of the received favicon.| 429 430## OnPageVisibleEvent<sup>12+</sup> 431 432Represents the callback invoked when the old page is not displayed and the new page is about to be visible. 433 434**System capability**: SystemCapability.Web.Webview.Core 435 436| Name | Type | Mandatory | Description | 437| -------------- | ---- | ---- | ---------------------------------------- | 438| url | string | Yes| URL of the new page that is able to be visible when the old page is not displayed.| 439 440## OnDataResubmittedEvent<sup>12+</sup> 441 442Represents the callback invoked when the web form data can be resubmitted. 443 444**System capability**: SystemCapability.Web.Webview.Core 445 446| Name | Type | Mandatory | Description | 447| -------------- | ---- | ---- | ---------------------------------------- | 448| handler | [DataResubmissionHandler](./arkts-basic-components-web-DataResubmissionHandler.md) | Yes| Handler for resubmitting web form data.| 449 450## OnAudioStateChangedEvent<sup>12+</sup> 451 452Represents the callback invoked when the audio playback status on the web page changes. 453 454**System capability**: SystemCapability.Web.Webview.Core 455 456| Name | Type | Mandatory | Description | 457| -------------- | ---- | ---- | ---------------------------------------- | 458| playing | boolean | Yes| Audio playback status on the current page. The value **true** means that audio is being played, and **false** means the opposite.| 459 460## OnFirstContentfulPaintEvent<sup>12+</sup> 461 462Represents the callback invoked when the first content paint occurs on the web page. 463 464**System capability**: SystemCapability.Web.Webview.Core 465 466| Name | Type | Mandatory | Description | 467| -------------- | ---- | ---- | ---------------------------------------- | 468| navigationStartTick | number | Yes| Navigation start time, in microseconds. | 469| firstContentfulPaintMs | number | Yes| Time between navigation and when the content is first rendered, in milliseconds.| 470 471## OnLoadInterceptEvent<sup>12+</sup> 472 473Represents the callback invoked when the **Web** component is about to access a URL. 474 475**System capability**: SystemCapability.Web.Webview.Core 476 477| Name | Type | Mandatory | Description | 478| -------------- | ---- | ---- | ---------------------------------------- | 479| data | [WebResourceRequest](./arkts-basic-components-web-WebResourceRequest.md) | Yes| Information about the URL request.| 480 481## OnOverScrollEvent<sup>12+</sup> 482 483Represents the callback invoked when the web page is overscrolled. 484 485**System capability**: SystemCapability.Web.Webview.Core 486 487| Name | Type | Mandatory | Description | 488| -------------- | ---- | ---- | ---------------------------------------- | 489| xOffset | number | Yes| Horizontal overscroll offset based on the leftmost edge of the web page.<br>Unit: vp.| 490| yOffset | number | Yes| Vertical overscroll offset based on the top edge of the web page.<br>Unit: vp.| 491 492## JavaScriptProxy<sup>12+</sup> 493 494Represents the JavaScript object to be injected. 495 496**System capability**: SystemCapability.Web.Webview.Core 497 498| Name | Type | Mandatory | Description | 499| -------------- | ---- | ---- | ---------------------------------------- | 500| object | object | Yes | Object to be registered. Methods can be declared, but attributes cannot. | 501| name | string | Yes | Name of the object to be registered, which is the same as that invoked in the window. | 502| methodList | Array\<string\> | Yes | Synchronous methods of the JavaScript object to be registered at the application side. | 503| controller | [WebController](./arkts-basic-components-web-WebController.md) \| [WebviewController<sup>9+</sup>](./arkts-apis-webview-WebviewController.md) | Yes | - | Controller. This API is deprecated since API version 9. You are advised to use **WebviewController** instead.| 504| asyncMethodList<sup>12+</sup> | Array\<string\> | No | Asynchronous methods of the JavaScript object to be registered at the application side. Asynchronous methods cannot obtain return values. | 505| permission<sup>12+</sup> | string | No | JSON string, which is empty by default. This string is used to configure JSBridge permission control and define the URL trustlist at the object and method levels.<br>For the example, see [Invoking Application Functions on the Frontend Page](../../web/web-in-page-app-function-invoking.md).| 506 507## OnPageEndEvent<sup>12+</sup> 508 509Represents the callback invoked when the web page loading ends. 510 511**System capability**: SystemCapability.Web.Webview.Core 512 513| Name | Type | Mandatory | Description | 514| -------------- | ---- | ---- | ---------------------------------------- | 515| url | string | Yes| URL of the page. | 516 517## OnPageBeginEvent<sup>12+</sup> 518 519Represents the callback invoked when the web page loading begins. 520 521**System capability**: SystemCapability.Web.Webview.Core 522 523| Name | Type | Mandatory | Description | 524| -------------- | ---- | ---- | ---------------------------------------- | 525| url | string | Yes| URL of the page. | 526 527## OnProgressChangeEvent<sup>12+</sup> 528 529Represents the callback invoked when the web page loading progress changes. 530 531**System capability**: SystemCapability.Web.Webview.Core 532 533| Name | Type | Mandatory | Description | 534| -------------- | ---- | ---- | ---------------------------------------- | 535| newProgress | number | Yes| New loading progress. The value is an integer ranging from 0 to 100. | 536 537## OnTitleReceiveEvent<sup>12+</sup> 538 539Represents the callback invoked when the document title of the web page is changed. 540 541**System capability**: SystemCapability.Web.Webview.Core 542 543| Name | Type | Mandatory | Description | 544| -------------- | ---- | ---- | ---------------------------------------- | 545| title | string | Yes| Document title. | 546| isRealTitle<sup>20+</sup> | boolean | No| Whether the document title is a real title. The value true indicates that the title is from the **title** tag of the web page, and **false** indicates that the title is automatically generated based on the URL. | 547 548## OnGeolocationShowEvent<sup>12+</sup> 549 550Represents the callback invoked when a request to obtain the geolocation information is received. 551 552**System capability**: SystemCapability.Web.Webview.Core 553 554| Name | Type | Mandatory | Description | 555| -------------- | ---- | ---- | ---------------------------------------- | 556| origin | string | Yes| Index of the origin. | 557| geolocation | [JsGeolocation](./arkts-basic-components-web-JsGeolocation.md) | Yes| User operation. | 558 559## NativeEmbedVisibilityInfo<sup>12+</sup> 560 561Provides visibility information about the same-layer tag. 562 563**System capability**: SystemCapability.Web.Webview.Core 564 565| Name | Type | Mandatory | Description | 566| ------------- | ------------------------------------| ----- | ------------------ | 567| visibility | boolean | Yes | Whether the same-layer tag is visible.<br>The value **true** indicates that the same-layer tag is visible, and **false** indicates the opposite. | 568| embedId | string | Yes | ID of the same-layer rendered tag. | 569 570## RenderProcessNotRespondingData<sup>12+</sup> 571 572Provides detailed information about the unresponsive rendering process. 573 574**System capability**: SystemCapability.Web.Webview.Core 575 576| Name | Type | Mandatory| Description | 577| ------------------------ | ------ | ---- | -------------------------------------- | 578| jsStack | string | Yes | JavaScript call stack information of the web page. | 579| pid | number | Yes | Process ID of the web page.| 580| reason | [RenderProcessNotRespondingReason](./arkts-basic-components-web-e.md#renderprocessnotrespondingreason12) | Yes | Reason why the rendering process does not respond.| 581 582## FullScreenEnterEvent<sup>12+</sup> 583 584Provides details about the event that the **Web** component to enter the full-screen mode. 585 586**System capability**: SystemCapability.Web.Webview.Core 587 588| Name | Type | Mandatory | Description | 589| ----------- | ------------------------------------ | ---- | --------------------- | 590| handler | [FullScreenExitHandler](./arkts-basic-components-web-FullScreenExitHandler.md) | Yes | Function handle for exiting full screen mode.| 591| videoWidth | number | No | Video width, in px. If the element that enters fulls screen mode is a **\<video>** element, the value represents its width; if the element that enters fulls screen mode contains a **\<video>** element, the value represents the width of the first sub-video element; in other cases, the value is **0**.| 592| videoHeight | number | No | Video height, in px. If the element that enters fulls screen mode is a **\<video>** element, the value represents its height; if the element that enters fulls screen mode contains a **\<video>** element, the value represents the height of the first sub-video element; in other cases, the value is **0**.| 593 594## LoadCommittedDetails<sup>11+</sup> 595 596Provides detailed information about the web page that has been submitted for redirection. 597 598**System capability**: SystemCapability.Web.Webview.Core 599 600| Name | Type | Mandatory | Description | 601| ----------- | ------------------------------------ | ---- | --------------------- | 602| isMainFrame | boolean | Yes | Whether the document is the main document.<br>The value **true** indicates that the document is the main document, and **false** indicates the opposite.| 603| isSameDocument | boolean | Yes | Whether to navigate without changing the document.<br>The value **true** means to navigate without changing the document, and **false** means the opposite.<br>Example of navigation in the same document: 1. navigation shown in the example; 2. navigation triggered by **pushState** or **replaceState**; 3. navigation to a history entry on the same page. | 604| didReplaceEntry | boolean | Yes | Whether the submitted new entry replaces the existing entry.<br>The value **true** indicates that the submitted new entry replaces the existing entry, and **false** indicates the opposite.<br>In certain scenarios for navigation to a subdocument, although the existing entry is not replaced, some attributes are changed. | 605| navigationType | [WebNavigationType](./arkts-basic-components-web-e.md#webnavigationtype11) | Yes | Navigation type. | 606| url | string | Yes | URL of the current navigated-to web page. | 607 608## NativeEmbedInfo<sup>11+</sup> 609 610Provides detailed information about the same-layer tag. 611 612**System capability**: SystemCapability.Web.Webview.Core 613 614| Name | Type | Mandatory | Description | 615|-------------------| ------------------------------------ | ---- |---------------------------| 616| id | string | No | ID of the same-layer tag. | 617| type | string | No | Type of the same-layer tag. The value is in lowercase. | 618| src | string | No | **src** information of the same-layer tag. | 619| width | number | No | Width of the same-layer tag, in px. | 620| height | number | No | Height of the same-layer tag, in px. | 621| url | string | No | URL of the same-layer tag. | 622| tag<sup>12+</sup> | string | No | Tag name, which is in uppercase. | 623| params<sup>12+</sup> | Map<string, string> | No | List of key-value pairs contained in the **object** tag that form a map of the Object type. Use the methods provided by the Object type, such as **embed.info?.param?.["name"]** to operate the map object. | 624| position<sup>12+</sup> | Position | No | Position of the same-layer tag relative to the **Web** component in the screen coordinate system, which is different from the standard **Position**. The unit is px.| 625 626## IntelligentTrackingPreventionDetails<sup>12+</sup> 627 628Provides detailed information about intelligent tracking prevention. 629 630**System capability**: SystemCapability.Web.Webview.Core 631 632| Name | Type | Mandatory | Description | 633| ------------- | ------------------------------------| ----- | ------------ | 634| host | string | Yes | Host name. | 635| trackerHost | string | Yes | Host name of the tracker. | 636 637## WebKeyboardCallbackInfo<sup>12+</sup> 638 639Represents input parameters of the callback used to intercept the soft keyboard started from editable elements on a web page, including [WebKeyboardController](./arkts-basic-components-web-WebKeyboardController.md) and editable element attributes. 640 641**System capability**: SystemCapability.Web.Webview.Core 642 643| Name | Type | Mandatory | Description | 644| -------------- | ------- | ---- | ---------------------------------------- | 645| controller | [WebKeyboardController](./arkts-basic-components-web-WebKeyboardController.md) | Yes | Controller used to control the input, deletion, and closure of the custom keyboard.| 646| attributes | Record<string, string> | Yes | Attribute of the web page element that triggers the display of the soft keyboard. 647 648## WebKeyboardOptions<sup>12+</sup> 649 650Represents the return value of the callback that intercepts the soft keyboard started from editable elements on the web page. You can specify the types of the keyboard, and return the value to the Web kernel to control the startup of different types of soft keyboards. 651 652**System capability**: SystemCapability.Web.Webview.Core 653 654| Name | Type | Mandatory | Description | 655| -------------- | ------- | ---- | ---------------------------------------- | 656| useSystemKeyboard | boolean | Yes | Whether to use the system's default soft keyboard.<br>The value **true** means to use the system's default soft keyboard, and **false** means the opposite.<br>Default value: **true**.| 657| enterKeyType | number | No | Type of the Enter key of the system soft keyboard. For details about the value range, see [EnterKeyType](../apis-ime-kit/js-apis-inputmethod.md#enterkeytype10). This parameter takes effect only when **useSystemKeyboard** is set to **true** and **enterKeyType** is set to a valid value.| 658| customKeyboard | [CustomBuilder](../apis-arkui/arkui-ts/ts-types.md#custombuilder8) | No | Builder of a custom keyboard. This parameter is required when **useSystemKeyboard** is set to **false**. After it is set, the **Web** component starts the custom keyboard as configured. 659 660 661## FirstMeaningfulPaint<sup>12+</sup> 662 663Provides detailed information about the first meaningful paint. 664 665**System capability**: SystemCapability.Web.Webview.Core 666 667| Name | Type | Mandatory| Description | 668| ------------------------ | ------ | ---- | -------------------------------------- | 669| navigationStartTime | number | No | Start time of the navigation, in microseconds. | 670| firstMeaningfulPaintTime | number | No | Time taken for the first meaningful paint of the page, in milliseconds.| 671 672## LargestContentfulPaint<sup>12+</sup> 673 674Provides detailed information about the largest content paint. 675 676**System capability**: SystemCapability.Web.Webview.Core 677 678| Name | Type | Mandatory| Description | 679| ------------------------- | ------ | ---- | ---------------------------------------- | 680| navigationStartTime | number | No | Start time of the navigation, in microseconds. | 681| largestImagePaintTime | number | No | Loading time of the maximum image, in milliseconds. | 682| largestTextPaintTime | number | No | Loading time of the maximum text, in milliseconds. | 683| largestImageLoadStartTime | number | No | Start time of the loading of the maximum image, in milliseconds.| 684| largestImageLoadEndTime | number | No | End time of the loading of the maximum image, in milliseconds.| 685| imageBPP | number | No | Number of pixels of the maximum image. | 686 687## NativeEmbedDataInfo<sup>11+</sup> 688 689Provides detailed information about the changes of the same-layer tag lifecycle. 690 691**System capability**: SystemCapability.Web.Webview.Core 692 693| Name | Type | Mandatory | Description | 694| ----------- | ------------------------------------ | ---- | --------------------- | 695| status | [NativeEmbedStatus](./arkts-basic-components-web-e.md#nativeembedstatus11) | No | Lifecycle status of the same-layer tag.| 696| surfaceId | string | No | Surface ID of the native image. | 697| embedId | string | No | Unique ID of the same-layer tag. | 698| info | [NativeEmbedInfo](./arkts-basic-components-web-i.md#nativeembedinfo11) | No | Detailed information about the same-layer tag. | 699 700## NativeEmbedTouchInfo<sup>11+</sup> 701 702Provides touch information of the same-layer tag. 703 704**System capability**: SystemCapability.Web.Webview.Core 705 706| Name | Type | Mandatory | Description | 707| ----------- | ------------------------------------ | ---- | --------------------- | 708| embedId | string | No | Unique ID of the same-layer tag.| 709| touchEvent | [TouchEvent](../apis-arkui/arkui-ts/ts-universal-events-touch.md#touchevent) | No | Touch action information.| 710| result<sup>12+</sup> | [EventResult](./arkts-basic-components-web-EventResult.md) | No | Gesture event consumption result.| 711 712## NativeEmbedMouseInfo<sup>20+</sup> 713 714Provides detailed information about clicking or touching and holding a same-layer tag using the mouse or touchpad. 715 716**System capability**: SystemCapability.Web.Webview.Core 717 718| Name | Type | Mandatory | Description | 719| ----------- | ------------------------------------ | ---- | --------------------- | 720| embedId | string | No | Unique ID of the same-layer tag.| 721| mouseEvent | [MouseEvent](../apis-arkui/arkui-ts/ts-universal-mouse-key.md#mouseevent) | No | Information about clicking or touching and holding using the mouse or touchpad.| 722| result | [EventResult](./arkts-basic-components-web-EventResult.md) | No | Mouse event consumption result.| 723 724## OnLoadStartedEvent<sup>20+</sup> 725 726Represents the callback invoked when the web page loading begins. 727 728**System capability**: SystemCapability.Web.Webview.Core 729 730| Name | Type | Mandatory | Description | 731| -------------- | ---- | ---- | ---------------------------------------- | 732| url | string | Yes| URL of the page. | 733 734## OnLoadFinishedEvent<sup>20+</sup> 735 736Represents the callback invoked when the web page loading ends. 737 738**System capability**: SystemCapability.Web.Webview.Core 739 740| Name | Type | Mandatory | Description | 741| -------------- | ---- | ---- | ---------------------------------------- | 742| url | string | Yes| URL of the page. | 743 744## Header 745 746Request or response header object returned by the **Web** component. 747 748**System capability**: SystemCapability.Web.Webview.Core 749 750| Name | Type | Mandatory | Description | 751| ----------- | ------ | ---- | ------------- | 752| headerKey | string | Yes | Key of the request or response header. | 753| headerValue | string | Yes | Value of the request or response header.| 754 755## ScreenCaptureConfig<sup>10+</sup> 756 757Provides the web screen capture configuration. 758 759**System capability**: SystemCapability.Web.Webview.Core 760 761| Name | Type | Mandatory | Description | 762| ----------- | --------------------------------------- | ---- | ---------- | 763| captureMode | [WebCaptureMode](./arkts-basic-components-web-e.md#webcapturemode10) | Yes | Web screen capture mode.| 764