1# Interfaces (Others) 2 3> **NOTE** 4> 5> - The initial APIs of this module are supported since API version 9. 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## WebStorageOrigin 10 11Provides usage information of the Web SQL Database. 12 13**System capability**: SystemCapability.Web.Webview.Core 14 15| Name | Type | Read-Only| Optional| Description| 16| ------ | ------ | ---- | ---- | ---- | 17| origin | string | No | No| Index of the origin.| 18| usage | number | No | No| Storage usage of the origin. | 19| quota | number | No | No| Storage quota of the origin. | 20 21## WebHeader 22 23Describes the request/response header returned by the **Web** component. 24 25**System capability**: SystemCapability.Web.Webview.Core 26 27| Name | Type | Read-Only| Optional|Description | 28| ----------- | ------ | -----|------|------------------- | 29| headerKey | string | No| No| Key of the request/response header. | 30| headerValue | string | No| No| Value of the request/response header.| 31 32## WebCustomScheme 33 34Defines a custom URL scheme. 35 36**System capability**: SystemCapability.Web.Webview.Core 37 38| Name | Type | Read-Only| Optional| Description | 39| -------------- | --------- | ---- | ---- | ---------------------------- | 40| schemeName | string | No | No | Name of the custom URL scheme. The value can contain a maximum of 32 characters, including lowercase letters, digits, periods (.), plus signs (+), and hyphens (-), and must start with a letter. | 41| isSupportCORS | boolean | No | No | Whether to support cross-origin resource sharing (CORS).<br>The value **true** means to support cross-origin resource sharing (CORS), and **false** means the opposite.<br>Default value: **true**. | 42| isSupportFetch | boolean | No | No | Whether to support fetch requests.<br>The value **true** means to support fetch requests, and **false** means the opposite.<br>Default value: **true**. | 43| isStandard<sup>12+</sup> | boolean | No | Yes | Whether the scheme is processed as a standard scheme. The standard scheme must comply with the URL normalization and parsing rules defined in section 3.1 of RFC 1738.<br>The value **true** indicates that the scheme is processed as a standard scheme, and **false** indicates the opposite.<br>Default value: **true**. | 44| isLocal<sup>12+</sup> | boolean | No | Yes | Whether the scheme is treated with the same security rules as those applied to file URLs.<br>The value **true** indicates that the scheme is treated with the same security rules as those applied to file URLs, and the value **false** indicates the opposite.<br>Default value: **true**. | 45| isDisplayIsolated<sup>12+</sup> | boolean | No | Yes | Whether the content of the scheme can be displayed or accessed from other content that uses the same scheme.<br>The value **true** indicates that the content of the scheme can only be displayed or accessed from other content that uses the same scheme, and **false** indicates the opposite.<br>Default value: **true**. | 46| isSecure<sup>12+</sup> | boolean | No | Yes | Whether the scheme is treated with the same security rules as those applied to HTTPS URLs. The value **true** indicates that the scheme is treated with the same security rules as those applied to HTTPS URLs, and **false** indicates the opposite.<br>Default value: **true**. | 47| isCspBypassing<sup>12+</sup> | boolean | No | Yes | Whether the scheme can bypass the content security policy (CSP) checks.<br>The value **true** indicates that the scheme can bypass the content security policy (CSP) checks, and **false** indicates the opposite.<br>Default value: **true**.<br>In most cases, this value should not be set when **isStandard** is set to **true**. | 48| isCodeCacheSupported<sup>12+</sup> | boolean | No | Yes | Whether JavaScript resources loaded with the scheme can be used to create a code cache.<br>The value **true** indicates that JavaScript resources loaded with the scheme can be used to create a code cache, and **false** indicates the opposite.<br>Default value: **false**. | 49 50## RequestInfo<sup>12+</sup> 51 52Describes the information about the resource request sent by the **Web** component. 53 54**System capability**: SystemCapability.Web.Webview.Core 55 56| Name | Type | Read-Only| Optional|Description | 57| ---------| ------ | -----|------|-------- | 58| url | string | No| No| URL of the request. | 59| method | string | No| No| Method of the request. | 60| formData | string | No| No| Form data in the request body.| 61 62## CacheOptions<sup>12+</sup> 63 64Represents a configuration object for precompiling JavaScript in the **Web** component to generate bytecode cache, which is designed to control the updating of the bytecode cache. 65 66**System capability**: SystemCapability.Web.Webview.Core 67 68| Name | Type | Read-Only| Optional|Description | 69| ----------- | ------ | -----|------|------------------- | 70| responseHeaders | Array<[WebHeader](#webheader)> | No| No| Array of response headers from the server when a JavaScript file is requested. They include information such as E-Tag or Last-Modified to identify the file version and determine whether the bytecode cache needs to be refreshed. | 71 72## SnapshotInfo<sup>12+</sup> 73 74Provides information used to obtain a full drawing result. 75 76**System capability**: SystemCapability.Web.Webview.Core 77 78| Name| Type| Mandatory| Description| 79|------|------|------|------| 80| id | string | No| Snapshot ID.| 81| size | [SizeOptions](../apis-arkui/arkui-ts/ts-types.md#sizeoptions) | No| Size for web rendering. The maximum size is 16000 px × 16000 px. The length unit can be px, vp, or %. The length unit must be the consistent across parameters. The default unit is vp. If the size exceeds the specifications, the maximum size is returned. Example: **width: '100px', height: '200px'** or **width: '20%', height'30%'**. If only digits are written, the unit is vp.| 82 83## SnapshotResult<sup>12+</sup> 84 85Represents a full drawing result. 86 87**System capability**: SystemCapability.Web.Webview.Core 88 89| Name| Type| Mandatory| Description| 90|------|------|--|---------| 91| id | string | No| Snapshot ID.| 92| status | boolean | No| Snapshot status. The value can be **true** (normal) or **false** (failure). If the full drawing result fails to be obtained, the width and height of the returned size are both 0, and the map is empty.| 93| size | [SizeOptions](../apis-arkui/arkui-ts/ts-types.md#sizeoptions) | No| Actual size drawn on the web page. The value is of the number type, and the unit is vp.| 94| imagePixelMap | [image.PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) | No| Full drawing result in image.pixelMap format.| 95 96## OfflineResourceMap<sup>12+</sup> 97 98Implements an **OfflineResourceMap** object, which is used to set information related to local offline resources that will be injected into memory cache through the [injectOfflineResources](./arkts-apis-webview-WebviewController.md#injectofflineresources12) API. The ArkWeb engine will generate resource caches based on this information and control the validity period of the cache accordingly. 99 100**System capability**: SystemCapability.Web.Webview.Core 101 102| Name | Type | Read-Only| Optional|Description | 103| ----------- | ------ | -----|------|------------------- | 104| urlList | Array\<string\> | No | No | List of network addresses of the local offline resources. The first item in the list is used as the resources' origin. If only one network address is provided, this single address is used for the resources' origin. The URL supports only the HTTP and HTTPS protocols and contains a maximum of 2048 characters. | 105| resource | Uint8Array | No | No | Content of a local offline resource. | 106| responseHeaders | Array<[WebHeader](#webheader)> | No | No | HTTP response headers corresponding to the resources. The **Cache-Control** or **Expires** response header is used to control the validity period of the resource in the memory cache. If neither of the headers is provided, a default validity time of 86400 seconds (1 day) will be applied. The **Content-Type** response header is used to define the MIME type of the resource. For resources of type MODULE_JS, a valid MIME type must be provided. For other types, the MIME type is optional, with no default value. A non-standard MIME type can lead to the resource being invalidated in the memory cache. If a **script** tag on the web page uses the **crossorigin** attribute, the **Cross-Origin** response header must be set in the **responseHeaders** parameter of the API. The value for this header should be **anonymous** or **use-credentials**. | 107| type | [OfflineResourceType](./arkts-apis-webview-e.md#offlineresourcetype12) | No | No | Resource type. Currently, only the JavaScript, image, and CSS types are supported. | 108 109## PdfConfiguration<sup>14+</sup> 110 111Specifies the input parameters of **createPdf()**. 112 113> **NOTE** 114> 115> The number of pixels is calculated as follows: Number of pixels = 96 x Number of inches. 116 117**System capability**: SystemCapability.Web.Webview.Core 118 119| Name | Type | Mandatory| Description | 120| --------------------- | ------- | ---- | ------------------------------------------------------------ | 121| width | number | Yes | Page width,<br>in inches.<br>Recommended value: 8.27 inches of A4 paper width. | 122| height | number | Yes | Page height,<br>in inches.<br>Recommended value: 11.69 inches of A4 paper height. | 123| scale | number | No | Scale multiple.<br>The value range is [0.0, 2.0]. If the value is less than 0.0, set it to **0.0**. If the value is greater than 2.0, set it to **2.0**.<br>Default value: **1.0**| 124| marginTop | number | Yes | Top margin.<br>The value range is [0.0, half of the page height). If the value is not within the value range, set it to **0.0**.<br>Unit: inch.| 125| marginBottom | number | Yes | Bottom margin.<br>The value range is [0.0, half of the page height). If the value is not within the value range, set it to **0.0**.<br>Unit: inch.| 126| marginRight | number | Yes | Right margin.<br>The value range is [0.0, half of the page width). If the value is not within the value range, set it to **0.0**.<br>Unit: inch.| 127| marginLeft | number | Yes | Left margin.<br>The value range is [0.0, half of the page width). If the value is not within the value range, set it to **0.0**.<br>Unit: inch.| 128| shouldPrintBackground | boolean | No | Whether to print the background color. The value **true** means to print the background color, and **false** means the opposite.<br>Default value: **false**. | 129 130## ScrollOffset<sup>13+</sup> 131 132Represents the current scrolling offset of a web page. 133 134**System capability**: SystemCapability.Web.Webview.Core 135 136| Name| Type | Read-Only| Optional| Description | 137| ---- | ------ | ---- | ---- | ------------------------------------------------------------ | 138| x | number | No | No | Horizontal scrolling offset of a web page. The value is the difference between the x-coordinate of the left boundary of the web page and that of the left boundary of the **Web** component.<br>When the web page is scrolled rightwards, the value is negative.<br>When the web page is not scrolled or scrolled leftwards, the value is **0** or positive.<br>Unit: vp| 139| y | number | No | No | Vertical scrolling offset of a web page. The value is the difference between the y-coordinate of the upper boundary of the web page and that of the upper boundary of the **Web** component.<br>When the web page is scrolled downwards, the value is negative.<br>When the web page is not scrolled or scrolled upwards, the value is **0** or positive.<br>Unit: vp| 140 141## HitTestValue 142 143Provides the element information of the area being clicked. For the sample code, see [getLastHitTest](./arkts-apis-webview-WebviewController.md#getlasthittest18). 144 145**System capability**: SystemCapability.Web.Webview.Core 146 147| Name| Type| Read-Only| Optional| Description| 148| ---- | ---- | ---- | ---- |---- | 149| type | [WebHitTestType](./arkts-apis-webview-e.md#webhittesttype) | No| No| Element type of the area being clicked.| 150| extra | string | No| No|Extra information of the area being clicked. If the area being clicked is an image or a link, the extra information is the URL of the image or link.| 151 152## ControllerAttachState<sup>20+</sup> 153 154Describes the attach status of WebViewController and the **Web** component. 155 156**System capability**: SystemCapability.Web.Webview.Core 157 158| Name| Value| Description| 159| ------------------------------- | - | ---------- | 160| UNATTACHED | 0 | Unattached.| 161| ATTACHED | 1 | Attached.| 162 163## BlanklessInfo<sup>20+</sup> 164 165Describes prediction information about blankless loading, including the first screen similarity, first screen loading duration, and error code. The application determines whether to enable the blankless loading solution based on the prediction information. 166 167**System capability**: SystemCapability.Web.Webview.Core 168 169| Name | Type | Read-Only| Optional|Description | 170| ----------- | ------ | -----|------|------------------- | 171| errCode | WebBlanklessErrorCode | No | No | Error code of blankless loading. For details, see [WebBlanklessErrorCode](./arkts-apis-webview-e.md#webblanklesserrorcode20).| 172| similarity | number | No | No | First screen similarity, which is calculated based on the historical first screen content. The value ranges from 0 to 1.0. 1.0 indicates that the content is the same. A value closer to 1 indicates a higher similarity. This value is lagging, and the similarity of local loading is displayed in the next loading. You are advised not to enable the blankless loading solution when the similarity is low.| 173| loadingTime | int | No | No | Loading duration estimated based on the historical first screen loading durations, in milliseconds. The value must be greater than 0.| 174 175## HistoryItem 176 177Describes a historical page record. 178 179**System capability**: SystemCapability.Web.Webview.Core 180 181| Name | Type | Read-Only| Optional| Description | 182| ------------- | -------------------------------------- | ---- | ---- | ---------------------------- | 183| icon | [image.PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) | Yes | No | **PixelMap** object of the icon on the historical page.| 184| historyUrl | string | No | No | URL of the historical page. | 185| historyRawUrl | string | No | No | Original URL of the historical page. | 186| title | string | No | No | Title of the historical page. | 187 188## MediaInfo<sup>12+<sup> 189 190Represents a **MediaInfo** object used as a parameter of the [CreateNativeMediaPlayerCallback](./arkts-apis-webview-t.md#createnativemediaplayercallback12) callback. 191The object contains information about media on the web page. The application may create, based on the information, a player that takes over media playback of the web page . 192 193**System capability**: SystemCapability.Web.Webview.Core 194 195| Name| Type| Mandatory| Description| 196|------|------|------|------| 197| embedID | string | Yes| ID of **\<video>** or **\<audio>** on the web page.| 198| mediaType | [MediaType](./arkts-apis-webview-e.md#mediatype12) | Yes| Type of the media.| 199| mediaSrcList | [MediaSourceInfo](./arkts-apis-webview-MediaSourceInfo.md)[] | Yes| Source of the media. There may be multiple sources. The application needs to select a supported source to play.| 200| surfaceInfo | [NativeMediaPlayerSurfaceInfo](./arkts-apis-webview-NativeMediaPlayerSurfaceInfo.md) | Yes| Surface information used for same-layer rendering.| 201| controlsShown | boolean | Yes| Whether the **controls** attribute exists in **\<video>** or **\<audio>**.<br>The value **true** means that the **controls** attribute exists in **\<video>** or **\<audio>**, and **false** means the opposite.| 202| controlList | string[] | Yes| Value of the **controlslist** attribute in **\<video>** or **\<audio>**.| 203| muted | boolean | Yes| Whether to mute the player.<br>The value **true** means to mute the player, and **false** means the opposite.| 204| posterUrl | string | Yes| URL of a poster.| 205| preload | [Preload](./arkts-apis-webview-e.md#preload12) | Yes| Whether preloading is required.| 206| headers | Record\<string, string\> | Yes| HTTP headers that need to be included in the player's request for media resources.| 207| attributes | Record\<string, string\> | Yes| Attributes in **\<video>** or **\<audio>**.| 208 209## RectEvent<sup>12+<sup> 210 211Defines a rectangle. 212 213**System capability**: SystemCapability.Web.Webview.Core 214 215| Name | Type | Read-Only| Optional| Description | 216| -------------- | --------- | ---- | ---- | ---------------------------- | 217| x | number | No | No | X-axis coordinate of the upper left corner of the rectangle. | 218| y | number | No | No | Y-axis coordinate of the upper left corner of the rectangle. | 219| width | number | No | No | Width of the rectangle. | 220| height | number | No | No | Height of the rectangle. | 221