Dialog class
Dialog instances are dispatched by the Page via the dialog event.
Signature
export declare abstract class Dialog
Remarks
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Dialog class.
Example
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.on('dialog', async dialog => {
console.log(dialog.message());
await dialog.dismiss();
await browser.close();
});
await page.evaluate(() => alert('1'));
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
handled |
boolean |
A boolean value indicating whether the dialog has been handled. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
A promise that resolves when the dialog has been accepted. | ||
|
The default value of the prompt, or an empty string if the dialog is not a | ||
|
A promise which will resolve once the dialog has been dismissed | ||
|
The message displayed in the dialog. | ||
|
The type of the dialog. |

