diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 4103eb062..9b9584790 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -1228,6 +1228,21 @@ declare namespace webview { */ static fetchCookie(url: string): Promise; + /** + * Gets all cookies for the given URL Asynchronously. + * + * @param { string } url - The URL for which the cookies are requested. + * @param { boolean } incognito - {@code true} gets all cookies for the given URL + * in incognito mode; {@code false} otherwise. + * @returns { Promise } - A promise resolved after the cookies of given URL have been gotten. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 17100002 - Invalid url. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + static fetchCookie(url: string, incognito: boolean): Promise; + /** * Gets all cookies for the given URL Asynchronously. * @@ -1276,6 +1291,24 @@ declare namespace webview { */ static configCookieSync(url: string, value: string, incognito?: boolean): void; + /** + * Set a single cookie (key-value pair) for the given URL. + * + * @param { string } url - The URL for which the cookie is to be set. + * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. + * @param { boolean } incognito - {@code true} set a single cookie (key-value pair) for the given URL + * in incognito mode; {@code false} otherwise. + * @param { boolean } includeHttpOnly - {@code true} HTTP-only cookies can also be overwritten; + * {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 17100002 - Invalid url. + * @throws { BusinessError } 17100005 - Invalid cookie value. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + static configCookieSync(url: string, value: string, incognito: boolean, includeHttpOnly: boolean): void; + /** * Set a single cookie (key-value pair) for the given URL Asynchronously. * @@ -1293,6 +1326,25 @@ declare namespace webview { */ static configCookie(url: string, value: string): Promise; + /** + * Set a single cookie (key-value pair) for the given URL Asynchronously. + * + * @param { string } url - The URL for which the cookie is to be set. + * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. + * @param { boolean } incognito - {@code true} set a single cookie (key-value pair) for the given URL + * in incognito mode; {@code false} otherwise. + * @param { boolean } includeHttpOnly - {@code true} HTTP-only cookies can also be overwritten; + * {@code false} otherwise. + * @returns { Promise } - A promise resolved after the cookies of given URL have been set. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 17100002 - Invalid url. + * @throws { BusinessError } 17100005 - Invalid cookie value. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + static configCookie(url: string, value: string, incognito: boolean, includeHttpOnly: boolean): Promise; + /** * Set a single cookie (key-value pair) for the given URL Asynchronously. *