CoreWebView2.ScriptDialogOpening Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
ScriptDialogOpening is raised when a JavaScript dialog (alert
, confirm
, prompt
, or beforeunload
) displays for the WebView.
public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs> ScriptDialogOpening;
member this.ScriptDialogOpening : EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs>
Public Custom Event ScriptDialogOpening As EventHandler(Of CoreWebView2ScriptDialogOpeningEventArgs)
Event Type
Remarks
This event only is raised if the AreDefaultScriptDialogsEnabled property is set to false
. This event suppresses dialogs or replaces default dialogs with custom dialogs.
If a deferral is not taken on the event args, the subsequent scripts are blocked until the event handler returns. If a deferral is taken, the scripts are blocked until the deferral is completed.