Dialog

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>).

Properties

url

The url of the frame where this dialog was initiated.

Returnsstring

message

The dialog message.

Returnsstring

type

The type of dialog. Possible values are: 'alert', 'confirm', 'prompt' and 'beforeunload'.

Returnsstring

defaultPrompt

Optional: The default dialog prompt

Returnsstring

Methods

dismiss(accept[, promptText])

Dismiss the dialog with the given values.

Arguments:

  • accept boolean. Whether to hit the accept button or cancel/reject (if applicable).
  • promptText string. Optional text to enter into a prompt field if present.

ReturnsPromise<void>

Edit this page on GitHub