2020-06-04 14:56:45 +00:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home ](./index.md ) > [puppeteer ](./puppeteer.md ) > [Dialog ](./puppeteer.dialog.md )
## Dialog class
2020-06-09 08:19:42 +00:00
Dialog instances are dispatched by the [Page ](./puppeteer.page.md ) via the `dialog` event.
2020-06-04 14:56:45 +00:00
< b > Signature:< / b >
```typescript
export declare class Dialog
```
2020-06-09 08:19:42 +00:00
## Remarks
2020-06-04 14:56:45 +00:00
2020-06-09 08:19:42 +00:00
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
2020-06-04 14:56:45 +00:00
2020-06-09 08:19:42 +00:00
```js
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'));
})();
```
2020-06-04 14:56:45 +00:00
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [accept(promptText) ](./puppeteer.dialog.accept.md ) | | |
| [defaultValue() ](./puppeteer.dialog.defaultvalue.md ) | | |
| [dismiss() ](./puppeteer.dialog.dismiss.md ) | | |
| [message() ](./puppeteer.dialog.message.md ) | | |
| [type() ](./puppeteer.dialog.type.md ) | | |