IJsDialogHandlerOnJSDialog Method |
Version 108.4.130
Called to run a JavaScript dialog.
Namespace:
CefSharp
Assembly:
CefSharp (in CefSharp.dll) Version: 108.4.130.0 (108.4.130.0)
Syntax bool OnJSDialog(
IWebBrowser chromiumWebBrowser,
IBrowser browser,
string originUrl,
CefJsDialogType dialogType,
string messageText,
string defaultPromptText,
IJsDialogCallback callback,
ref bool suppressMessage
)
bool OnJSDialog(
IWebBrowser^ chromiumWebBrowser,
IBrowser^ browser,
String^ originUrl,
CefJsDialogType dialogType,
String^ messageText,
String^ defaultPromptText,
IJsDialogCallback^ callback,
bool% suppressMessage
)
Parameters
- chromiumWebBrowser
- Type: CefSharpIWebBrowser
the ChromiumWebBrowser control - browser
- Type: CefSharpIBrowser
the browser object - originUrl
- Type: SystemString
originating url - dialogType
- Type: CefSharpCefJsDialogType
Dialog Type - messageText
- Type: SystemString
Message Text - defaultPromptText
- Type: SystemString
value will be specified for prompt dialogs only - callback
- Type: CefSharpIJsDialogCallback
Callback can be executed inline or in an async fashion - suppressMessage
- Type: SystemBoolean
Set suppressMessage to true and return false to suppress the message (suppressing messages is preferable to immediately executing the callback as this is used to detect presumably malicious behavior like spamming alert messages in onbeforeunload). Set suppressMessage to false and return false to use the default implementation (the default implementation will show one modal dialog at a time and suppress any additional dialog requests until the displayed dialog is dismissed).
Return Value
Type:
BooleanReturn true if the application will use a custom dialog or if the callback has been executed immediately. Custom dialogs may be either modal or modeless. If a custom dialog is used the application must execute |callback| once the custom dialog is dismissed.
See Also