onJSDialog

open fun onJSDialog(browser: CefBrowser, origin_url: String, dialog_type: CefJSDialogHandler.JSDialogType, message_text: String, default_prompt_text: String, callback: CefJSDialogCallback, suppress_message: BoolRef): Boolean

Called to run a JavaScript dialog. Set suppress_message 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 suppress_message 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 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.

Return

false to use the default dialog implementation. Return true if the application will use a custom dialog.

Parameters

browser

The corresponding browser.

origin_url

The originating url.

dialog_type

the dialog type.

message_text

the text to be displayed.

default_prompt_text

value will be specified for prompt dialogs only.

callback

execute callback once the custom dialog is dismissed.

suppress_message

set to true to suppress displaying the message.