mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
See commits for details. Closes #1837, #5880, #7822, #8101, #8821, #9367, #9382, #9378, #4731
1.3 KiB
1.3 KiB
sidebar_label
| sidebar_label |
|---|
| Dialog |
Dialog class
Dialog instances are dispatched by the Page via the dialog event.
Signature:
export declare 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';
(async () => {
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();
});
page.evaluate(() => alert('1'));
})();
Methods
| Method | Modifiers | Description |
|---|---|---|
| accept(promptText) | ||
| defaultValue() | ||
| dismiss() | ||
| message() | ||
| type() |