Dialogs represent javascript alert, confirm and prompt informational messages.
The Dialog class is initiated from window.alert
, window.confirm
, and other dialog prompt calls in a webpage. Dialogs will block ALL execution of a webpage, so it is important to handle them by dismissing or taking appropriate action. To listen for dialogs, register a listener on each tab using tab.on('dialog', (dialog: Dialog) => ...<callback>)
.
The url of the frame where this dialog was initiated.
string
The dialog message.
string
The type of dialog. Possible values are: 'alert', 'confirm', 'prompt' and 'beforeunload'.
string
Optional: The default dialog prompt
string
Dismiss the dialog with the given values.
boolean
. Whether to hit the accept button or cancel/reject (if applicable).string
. Optional text to enter into a prompt field if present.Promise<void>