| Off<sup>(deprecated)</sup> | 0 |HTTPDNS is not used. This value can be used to revoke the previously used HTTPDNS configuration.<br>This API is deprecated since API version 10. You are advised to use **OFF** instead.|
| Auto<sup>(deprecated)</sup> | 1 |HTTPDNS is used in automatic mode. When the specified HTTPDNS server is unavailable for resolution, the component will fall back to the system DNS server.<br>This API is deprecated since API version 10. You are advised to use **AUTO** instead.|
| SecureOnly<sup>(deprecated)</sup> | 2 |The specified HTTPDNS server is forcibly used for DNS resolution.<br>This API is deprecated since API version 10. You are advised to use **SECURE_ONLY** instead.|
| OFF | 0 |HTTPDNS is not used. This value can be used to revoke the previously used HTTPDNS configuration.|
| OFF | 0 |HTTPDNS is not used. This value can be used to revoke the previously used HTTPDNS configuration.|
| AUTO | 1 |HTTPDNS is used in automatic mode. When the specified HTTPDNS server is unavailable for resolution, the component will fall back to the system DNS server.|
| AUTO | 1 |HTTPDNS is used in automatic mode. When the specified HTTPDNS server is unavailable for resolution, the component will fall back to the system DNS server.|
| SECURE_ONLY | 2 |The specified HTTPDNS server is forcibly used for DNS resolution.|
| SECURE_ONLY | 2 |The specified HTTPDNS server is forcibly used for DNS resolution.|
@@ -809,12 +809,16 @@ Sets the scale factor of the entire page. The default value is 100%.
...
@@ -809,12 +809,16 @@ Sets the scale factor of the entire page. The default value is 100%.
}
}
```
```
### userAgent
### userAgent<sup>(deprecated)</sup>
userAgent(userAgent: string)
userAgent(userAgent: string)
Sets the user agent.
Sets the user agent.
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [setCustomUserAgent](../apis/js-apis-webview.md#setcustomuseragent10)<sup>10+</sup> instead.
**Parameters**
**Parameters**
| Name | Type | Mandatory | Default Value | Description |
| Name | Type | Mandatory | Default Value | Description |
...
@@ -2194,7 +2198,8 @@ Called to process an HTML form whose input type is **file**, in response to the
...
@@ -2194,7 +2198,8 @@ Called to process an HTML form whose input type is **file**, in response to the
```ts
```ts
// xxx.ets
// xxx.ets
importweb_webviewfrom'@ohos.web.webview'
importweb_webviewfrom'@ohos.web.webview';
importpickerfrom'@ohos.file.picker';
@Entry
@Entry
@Component
@Component
...
@@ -2203,24 +2208,18 @@ Called to process an HTML form whose input type is **file**, in response to the
...
@@ -2203,24 +2208,18 @@ Called to process an HTML form whose input type is **file**, in response to the
@@ -3513,7 +3525,8 @@ Called to indicate the offset by which the web page overscrolls.
...
@@ -3513,7 +3525,8 @@ Called to indicate the offset by which the web page overscrolls.
onControllerAttached(callback: () => void)
onControllerAttached(callback: () => void)
Called when the controller is successfully bound to the **\<Web>** component. The controller must be WebviewController.
Called when the controller is successfully bound to the **\<Web>** component. The controller must be WebviewController.
As the web page is not yet loaded when this callback is called, APIs for operating the web page cannot be used in the callback, for example, [zoomIn](../apis/js-apis-webview.md#zoomin) and [zoomOut]. (../apis/js-apis-webview.md#zoomout). Other APIs, such as [loadUrl] (../apis/js-apis-webview.md#loadurl) and [getWebId] (../apis/js-apis-webview.md#getwebid), which do not involve web page operations, can be used properly.
As the web page is not yet loaded when this callback is called, APIs for operating the web page cannot be used in the callback, for example, [zoomIn](../apis/js-apis-webview.md#zoomin) and [zoomOut](../apis/js-apis-webview.md#zoomout). Other APIs, such as [loadUrl](../apis/js-apis-webview.md#loadurl) and [getWebId](../apis/js-apis-webview.md#getwebid), which do not involve web page operations, can be used properly.