Skip to content

OnScriptDialogOpening - cWebView2Browser

Sent when the page tries to open a script dialog

Type: Event

Parameters

Parameter Type Description
sUrl String URL of the page trying to open the script dialog
eKind OLECOREWEBVIEW2_SCRIPT_DIALOG_KIND Kind of script dialog being openedOLECOREWEBVIEW2_SCRIPT_DIALOG_KIND_ALERT or OLECOREWEBVIEW2_SCRIPT_DIALOG_KIND_CONFIRM orOLECOREWEBVIEW2_SCRIPT_DIALOG_KIND_PROMPT orOLECOREWEBVIEW2_SCRIPT_DIALOG_KIND_BEFOREUNLOAD
sMessage String Text to be shown
sDefaultText String Default value for prompt dialogs
ByRef sResultText String Set to the result text of a prompt dialog
ByRef bAccept Boolean Set to True if the confirm dialog result is positive

Syntax

Procedure OnScriptDialogOpening String sUrl OLECOREWEBVIEW2_SCRIPT_DIALOG_KIND eKind String sMessage String sDefaultText ByRef String sResultText ByRef Boolean bAccept

Description

This message is sent when the page tries to open a script dialog.

Usually this is done from JavaScript by calling window.alert, window.confirm or window.prompt.

This message will only be sent if pbAreDefaultScriptDialogsEnabled is set to False.

Implement this message to implement custom script dialogs where the result can be written to sResultText or bAccept.