Skip to content

Latest commit

 

History

History
109 lines (69 loc) · 4.25 KB

corewebview2scriptdialogopeningeventargs.md

File metadata and controls

109 lines (69 loc) · 4.25 KB
description title ms.date keywords topic_type api_type api_location api_name
Event args for the CoreWebView2.ScriptDialogOpening event.
CoreWebView2ScriptDialogOpeningEventArgs
02/26/2024
webview2, webview, winrt, win32, edge, CoreWebView2, CoreWebView2Controller, browser control, edge html, CoreWebView2ScriptDialogOpeningEventArgs
APIRef
Assembly
Microsoft.Web.WebView2.Core.dll
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.DefaultText
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.Kind
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.Message
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.ResultText
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.Uri
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.Accept
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.GetDeferral
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.get_DefaultText
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.get_Kind
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.get_Message
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.get_ResultText
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.get_Uri
Microsoft.Web.WebView2.Core.CoreWebView2ScriptDialogOpeningEventArgs.put_ResultText

CoreWebView2ScriptDialogOpeningEventArgs Class

Event args for the CoreWebView2.ScriptDialogOpening event.

Summary

Members Description
DefaultText Gets the default value to use for the result of the prompt JavaScript function.
Kind Gets the kind of JavaScript dialog box.
Message Gets the message of the dialog box.
ResultText Gets or sets the return value from the JavaScript prompt function if CoreWebView2ScriptDialogOpeningEventArgs.Accept is run.
Uri Gets the URI of the page that requested the dialog box.
Accept Responds with OK to confirm, prompt, and beforeunload dialogs. Not run this method to indicate cancel.
GetDeferral Gets a Deferral object.

Properties

DefaultText

readonly string DefaultText

Gets the default value to use for the result of the prompt JavaScript function. This is the second parameter passed to the JavaScript prompt dialog.

Kind

readonly CoreWebView2ScriptDialogKind Kind

Gets the kind of JavaScript dialog box.

Message

readonly string Message

Gets the message of the dialog box. From JavaScript this is the first parameter passed to alert, confirm, and prompt and is empty for beforeunload.

ResultText

string ResultText

Gets or sets the return value from the JavaScript prompt function if CoreWebView2ScriptDialogOpeningEventArgs.Accept is run. This value is ignored for CoreWebView2ScriptDialogOpeningEventArgs.Kinds other than CoreWebView2ScriptDialogKind.Prompt. If CoreWebView2ScriptDialogOpeningEventArgs.Accept is not run, this value is ignored and false is returned from prompt.

Uri

readonly string Uri

Gets the URI of the page that requested the dialog box.

Methods

Accept

void Accept()

Responds with OK to confirm, prompt, and beforeunload dialogs. Not run this method to indicate cancel. From JavaScript, this means that the confirm function and beforeunload event returns true if Accept is run. And for the prompt function it returns the value of CoreWebView2ScriptDialogOpeningEventArgs.ResultText if Accept is run and otherwise returns false.

GetDeferral

Deferral GetDeferral()

Gets a Deferral object. Use this to Complete the event at a later time.

Referenced by