Example of loading local resource files in the sandbox:
1. Use[globalthis](../../application-models/uiability-data-sync-with-ui.md#using-globalthis-between-uiability-and-page) to obtain the path of the sandbox.
1. Use[globalthis](../../application-models/uiability-data-sync-with-ui.md#using-globalthis-between-uiability-and-page) to obtain the path of the sandbox.
Sets whether to enable the multi-window permission.
Enabling the multi-window permission requires implementation of the **onWindowNew** event. For details about the sample code, see [onWindowNew](#onwindownew9).
**Parameters**
| Name | Type | Mandatory | Default Value | Description |
...
...
@@ -556,7 +558,7 @@ Sets whether to enable the multi-window permission.
// Return the WebviewController object corresponding to the new window to the <Web> kernel.
// If opening a new window is not needed, set the parameter to null when calling the event.handler.setWebController API.
// If the event.handler.setWebController API is not called, the render process will be blocked.
event.handler.setWebController(popController)
})
}
}
}
```
### mediaOptions<sup>10+</sup>
mediaOptions(options: WebMediaOptions)
Sets the web-based media playback policy, including the validity period for automatically resuming a paused web audio, and whether the audio of multiple **\<Web>** instances in an application is exclusive.
> **NOTE**
>
> - Audios in the same **\<Web>** instance are considered as the same audio.
> - The media playback policy controls videos with an audio track.
> - After the parameter settings are updated, the playback must be started again for the settings to take effect.
> - It is recommended that you set the same **audioExclusive** value for all **\<Web>** components.
**Parameters**
| Name| Type| Mandatory| Default Value | Description |
| options | [WebMediaOptions](#webmediaoptions10) | Yes | {resumeInterval: 0, audioExclusive: true} | Web-based media playback policy. The default value of **resumeInterval** is **0**, indicating that the playback is not automatically resumed.|
@@ -3132,7 +3275,7 @@ Obtains the path and name of the web page source file.
## JsResult
Implements the **JsResult** object, which indicates the result returned to the **\<Web>** component to indicate the user operation performed in the dialog box. For the sample code, see [onAlert Event](#onalert).
Implements the **JsResult** object, which indicates the result returned to the **\<Web>** component to indicate the user operation performed in the dialog box. For the sample code, see [onAlert](#onalert).
### handleCancel
...
...
@@ -3176,13 +3319,13 @@ Implements a **WebviewController** object for new **\<Web>** components. For the
| controller | [WebviewController](../apis/js-apis-webview.md#webviewcontroller) | Yes | - | **WebviewController** object of the **\<Web>** component.|
| controller | [WebviewController](../apis/js-apis-webview.md#webviewcontroller) | Yes | - | **WebviewController** object of the **\<Web>** component. If opening a new window is not needed, set it to **null**.|
## WebResourceError
...
...
@@ -3276,6 +3419,18 @@ Checks whether the resource request is associated with a gesture (for example, a
| ------- | -------------------- |
| boolean | Whether the resource request is associated with a gesture (for example, a tap).|
### getRequestMethod<sup>9+</sup>
getRequestMethod(): string
Obtains the request method.
**Return value**
| Type | Description |
| ------- | -------------------- |
| string | Request method.|
## Header
Describes the request/response header returned by the **\<Web>** component.
...
...
@@ -3984,6 +4139,15 @@ Enumerates the error codes returned by **onSslErrorEventReceive** API.
| On | The web dark mode is enabled. |
| Auto | The web dark mode setting follows the system settings. |
## WebMediaOptions<sup>10+</sup>
Describes the web-based media playback policy.
| Name | Type | Readable| Writable| Mandatory| Description |
| resumeInterval | number | Yes | Yes | No |Validity period for automatically resuming a paused web audio, in seconds. The maximum validity period is 60 seconds.|
| audioExclusive | boolean | Yes | Yes | No | Whether the audio of multiple **\<Web>** instances in an application is exclusive. |
## DataResubmissionHandler<sup>9+</sup>
Implements the **DataResubmissionHandler** object for resubmitting or canceling the web form data.