From 3e0fca2e86c0821a13f2db5988613c950490a001 Mon Sep 17 00:00:00 2001 From: cpeng1101 Date: Thu, 26 Jun 2025 10:44:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=B3=E9=97=ADPNA?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cpeng1101 --- api/@ohos.web.webview.d.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 5911146701..ec7b3cb744 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -6661,6 +6661,29 @@ declare namespace webview { * @since 20 */ static setBlanklessLoadingCacheCapacity(capacity: number) : number; + + /** + * After enable PrivateNetworkAccess feature, ArkWeb will send a CORS preflight request before issuing any + * 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 + * @since 20 + */ + static enablePrivateNetworkAccess(enable: boolean): void; + + /** + * 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 + * @since 20 + */ + static isPrivateNetworkAccessEnabled(): boolean; } /** -- Gitee