diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index bfb3e08770679948b52f74dcd77dce651738272f..3c7d8c062074311d1d86a09967a168a13fc6b0ae 100755 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -288,6 +288,12 @@ declare class JsResult { * @since 8 */ handleConfirm(): void; + + /** + * Handle the user's JavaScript result if confirm the prompt dialog. + * @since 9 + */ + handlePromptConfirm(result: string): void; } /** @@ -1120,6 +1126,14 @@ declare class WebAttribute extends CommonMethod { */ onConfirm(callback: (event?: { url: string, message: string, result: JsResult }) => boolean): WebAttribute; + /** + * Triggered when the web page wants to display a JavaScript prompt() dialog. + * @param callback The Triggered function when the web page wants to display a JavaScript prompt() dialog. + * + * @since 9 + */ + onPrompt(callback: (event?: {url: string, message: string, value: string, result: JsResult }) => boolean): WebAttribute; + /** * Triggered when the web page receives a JavaScript console message. * @param callback The triggered function when the web page receives a JavaScript console message.