Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pptr/mod.ts>Dialog

Headless Chrome Deno API
Latest
class Dialog
Re-export
import { Dialog } from "https://deno.land/x/pptr@1.2.0/mod.ts";

Dialog instances are dispatched by the Page via the dialog event.

Examples

Example 1

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'));
})();

Constructors

new
Dialog(
client: CDPSession,
message: string,
defaultValue?,
)

Properties

private
_client: CDPSession
private
_defaultValue: string
private
_handled: boolean
private
_message: string

Methods

accept(promptText?: string): Promise<void>
defaultValue(): string
dismiss(): Promise<void>
message(): string