Home Reference Source
public class | source

Dialog

Utility class for handling dialogs

See:

Constructor Summary

Public Constructor
public

constructor(client: Chrome | CRIConnection | CDPSession | Object, event: Object)

Member Summary

Private Members
private
private
private

Method Summary

Public Methods
public

async accept(promptText: string): Promise<void>

Accepts this JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

public

Default dialog prompt

public

async dismiss(): Promise<void>

Dismisses this JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload)

public

True iff browser is capable showing or acting on the given dialog.

public

Message that will be displayed by the dialog

public
public

Dialog type

public

url(): string

The URL of the Frame the dialog opened in

Public Constructors

public constructor(client: Chrome | CRIConnection | CDPSession | Object, event: Object) source

Params:

NameTypeAttributeDescription
client Chrome | CRIConnection | CDPSession | Object
event Object

Private Members

private _client: Chrome | CRIConnection | CDPSession | Object source

private _event: Object source

private _handled: boolean source

Public Methods

public async accept(promptText: string): Promise<void> source

Accepts this JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

Params:

NameTypeAttributeDescription
promptText string
  • optional

The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog

Return:

Promise<void>

public defaultValue(): string source

Default dialog prompt

Return:

string (nullable: true)

public async dismiss(): Promise<void> source

Dismisses this JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload)

Return:

Promise<void>

public hasBrowserHandler(): boolean source

True iff browser is capable showing or acting on the given dialog. When browser has no dialog handler for given target, calling alert while Page domain is engaged will stall the page execution. Execution can be resumed via calling either accept or dismiss

Return:

boolean

public message(): string source

Message that will be displayed by the dialog

Return:

string

public toJSON(): Object source

Return:

Object

public type(): string source

Dialog type

Return:

string

public url(): string source

The URL of the Frame the dialog opened in

Return:

string