puppeteer/website/versioned_docs/version-10.0.0/puppeteer.dialog.md
TASNEEM KOUSHAR 34ff00e2fe
chore(docs): generate site for v10.0.0
* fix: added parts of website

* fix: removed unnecessary lines

* fix: updated contributing.md

* fix: added parts of sidebar

* fix: added all APIs

* fix: added version 10.0.0

Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
2021-08-09 09:57:14 +01:00

1.2 KiB

Home > puppeteer > 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

const puppeteer = require('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()