diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index e41a70ce663d4d6f1b378f61d1b6fb73ab720980..7e2ccdb7d3dfc5c81b8fff04c50658e90ae368ba 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -893,10 +893,10 @@ declare namespace webview { * The horizontal scroll offset of the web page. The value is the difference between * the x-coordinate of the left border of the web page and the x-coordinate of the * left border of the Web component. When the web page scrolls to the right, - * the value range is negative. + * the value range is negative. * When the web page is not over-scrolled or the web page is over-scrolled to the left, * the value is 0 or a positive value. Unit: vp. - * + * * @type { number } * @syscap SystemCapability.Web.Webview.Core * @atomicservice @@ -905,13 +905,13 @@ declare namespace webview { x: number; /** - * The vertical scroll offset of the web page. The value is the difference between - * the y-coordinate of the upper border of the web page and the y-coordinate of the + * The vertical scroll offset of the web page. The value is the difference between + * the y-coordinate of the upper border of the web page and the y-coordinate of the * upper boundary of the Web component. When the web page is scrolled down, - * the value range is negative. + * the value range is negative. * When the web page is not over-scrolled or the web page is over-scrolled to the up, * the value is 0 or a positive value. Unit: vp. - * + * * @type { number } * @syscap SystemCapability.Web.Webview.Core * @atomicservice @@ -1059,7 +1059,7 @@ declare namespace webview { /** * Obtains information about all origins that are currently using the Web SQL Database. * This API uses a promise to return the result. - * + * * @returns { Promise> } - Promise used to return the information about the origins. * For details, see {@link WebStorageOrigin}. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -1094,7 +1094,7 @@ declare namespace webview { /** * Obtains information about all origins that are currently using the Web SQL Database. * This API uses an asynchronous callback to return the result. - * + * * @param { AsyncCallback> } callback - Callback used to return the information about the * origins. For details, see {@link WebStorageOrigin}. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -1368,7 +1368,7 @@ declare namespace webview { *

API Note:
* You must load the Web component before calling the APIs in GeolocationPermissions. *

- * + * * @syscap SystemCapability.Web.Webview.Core * @crossplatform * @atomicservice @@ -1398,7 +1398,7 @@ declare namespace webview { /** * Allows the specified origin to use the geolocation information. * @param { string } origin - Index of the origin. - * @param { boolean } incognito - Whether to allow the specified origin to use the geolocation information + * @param { boolean } incognito - Whether to allow the specified origin to use the geolocation information * in incognito mode. {@code true} means to allow the specified origin to use the * geolocation information in incognito mode; {@code false} means to allow the * specified origin to use the geolocation information in normal non-incognito mode. @@ -1751,8 +1751,8 @@ declare namespace webview { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 17100002 - URL error. No valid cookie found for the specified URL. - * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified - *
in RFC 6265. + * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified + *
in RFC 6265. * @syscap SystemCapability.Web.Webview.Core * @since 9 * @deprecated since 11 @@ -1770,7 +1770,7 @@ declare namespace webview { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 17100002 - URL error. No valid cookie found for the specified URL. - * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified + * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified *
in RFC 6265. * @syscap SystemCapability.Web.Webview.Core * @atomicservice @@ -1790,7 +1790,7 @@ declare namespace webview { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 17100002 - URL error. No valid cookie found for the specified URL. - * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified + * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified *
in RFC 6265. * @syscap SystemCapability.Web.Webview.Core * @since 14 @@ -1806,7 +1806,7 @@ declare namespace webview { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 17100002 - URL error. No valid cookie found for the specified URL. - * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified + * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified *
in RFC 6265. * @syscap SystemCapability.Web.Webview.Core * @crossplatform @@ -1828,7 +1828,7 @@ declare namespace webview { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 17100002 - URL error. No valid cookie found for the specified URL. - * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified + * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified *
in RFC 6265. * @syscap SystemCapability.Web.Webview.Core * @since 14 @@ -1844,7 +1844,7 @@ declare namespace webview { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 17100002 - URL error. No valid cookie found for the specified URL. - * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified + * @throws { BusinessError } 17100005 - The provided cookie value is invalid. It must follow the format specified *
in RFC 6265. * @syscap SystemCapability.Web.Webview.Core * @crossplatform @@ -3640,7 +3640,7 @@ declare namespace webview { */ ERR_SIGNIFICANT_CHANGE = -5 } - + /** * Defines the blankless information. * @@ -3775,7 +3775,7 @@ declare namespace webview { /** * Sets whether to enable web debugging. By default, web debugging is disabled. * For details, see Debugging Frontend Pages by Using DevTools. - * + * *

API Note:
* Enabling web debugging allows users to check and modify the internal status of the web page, * which poses security risks. Therefore, you are advised not to enable this function @@ -4811,7 +4811,7 @@ declare namespace webview { * The state of JavaScript is no longer persisted across navigations like loadUrl. * For example, global variables and functions defined before calling loadUrl will not exist in the loaded page.
* It is recommended that applications use registerJavaScriptProxy to ensure that the JavaScript state can be persisted across page navigations.
- * If you cannot obtain the return value by executing the asynchronous method, + * If you cannot obtain the return value by executing the asynchronous method, * you need to determine whether to use synchronous or asynchronous mode based on the specific situation. *

* @@ -6146,7 +6146,7 @@ declare namespace webview { onCreateNativeMediaPlayer(callback: CreateNativeMediaPlayerCallback): void; /** - * Enables the full drawing capability for the web page. + * Enables the full drawing capability for the web page. * This API works only during Web component initialization. * * @syscap SystemCapability.Web.Webview.Core @@ -6422,8 +6422,8 @@ declare namespace webview { /** * Sets a path list. When a file protocol accesses resources in the path list, it can access the local files across * domains. In addition, when a path list is set, the file protocol can access only the resources in the path list. - * The behavior of {@link fileAccess} will be overwritten by that of this API. - * + * The behavior of {@link fileAccess} will be overwritten by that of this API. + * * The paths in the list must be any of the following(sub path and module name must be provided): * * 1. The path of subdirectory of the application file directory, like "/data/storage/el2/base/files/example" @@ -6436,7 +6436,7 @@ declare namespace webview { * If a path in the list is not of the preceding paths, error code 401 is reported and the path list fails * to be set. When the path list is set to empty, the accessible files for the file protocol are subject to * the behavior of the {@link fileAccess}. - * + * * @param { Array } pathList - The path list allow universal access. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Parameter string is too long. 3.Parameter verification failed. @@ -6567,7 +6567,7 @@ declare namespace webview { * @since 20 */ static setUserAgentForHosts(userAgent: string, hosts : Array) : void; - + /** * Get whether webviewController is attached to a web component. * @returns { ControllerAttachState } the attach state of controller @@ -6735,7 +6735,7 @@ declare namespace webview { * @since 20 */ getErrorPageEnabled(): boolean; - + /** * Set whether enable the error page. onOverrideErrorPage will be triggered when the page error. * @@ -6752,7 +6752,7 @@ declare namespace webview { * sub-resource private network requests to request explicit permission from the target server. * After disable PrivateNetworkAccess, ArkWeb will no longer check whether the private network request * is legitimate. - * + * * @param {boolean} enable - {@code true} enable the private network access check; {@code false} otherwise. * @static * @syscap SystemCapability.Web.Webview.Core @@ -6762,7 +6762,7 @@ declare namespace webview { /** * Get whether PrivateNetworkAccess is enabled. - * + * * @returns {boolean} True is enable the ability to check private network access else false. * @static * @syscap SystemCapability.Web.Webview.Core @@ -6792,7 +6792,7 @@ declare namespace webview { /** * ‌Retrieve whether the automatic pre-connection feature is enabled‌. - * + * * @returns { boolean } Return true if enabled, false if disabled. * @static * @syscap SystemCapability.Web.Webview.Core @@ -6800,6 +6800,20 @@ declare namespace webview { * @arkts 1.1&1.2 */ static isAutoPreconnectEnabled(): boolean; + + /** + * Sets whether to switch web scrollbar mode. + * + * @param { ScrollbarMode } scrollbarMode - web scrollbar mode, default OVERLAY_LAYOUT_SCROLLBAR. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3.Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Web.Webview.Core + * @static + * @since 22 + * @arkts 1.1&1.2 + */ + static setScrollbarMode(scrollbarMode: ScrollbarMode): void; } /** @@ -9617,7 +9631,7 @@ declare namespace webview { * @syscap SystemCapability.Web.Webview.Core * @since 20 */ - enum WebDestroyMode { + enum WebDestroyMode { /** * The normal destroy mode, when the web component triggers destroy, * the resources will be released at the appropriate time. @@ -9634,6 +9648,30 @@ declare namespace webview { FAST_MODE = 1 } + /** + * Enum type supplied to {@link setScrollbarMode} for indicating the web component scrollbar mode. + * @enum { number } + * @syscap SystemCapability.Web.Webview.Core + * @since 22 + */ + enum ScrollbarMode { + /** + * The normal scrollbar mode, A scrollbar suspended above the content, + * appearing when scrolling and automatically hiding when stationary. + * Draw using layout viewport, which can be dragged and dropped. + * @syscap SystemCapability.Web.Webview.Core + * @since 22 + */ + OVERLAY_LAYOUT_SCROLLBAR = 0, + + /** + * The Resident scrollbar mode, Always display a fixed position scrollbar in the content area. + * @syscap SystemCapability.Web.Webview.Core + * @since 22 + */ + FORCE_DISPLAY_SCROLLBAR = 1 + } + } export default webview;