Skip to main content
Module

x/puppeteer/mod.ts>Dialog

A port of puppeteer running on Deno
Latest
class Dialog
Re-export
import { Dialog } from "https://deno.land/x/puppeteer@16.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,
type: Protocol.Page.DialogType,
message: string,
defaultValue?: string,
)

Methods

accept(promptText?: string): Promise<void>
defaultValue(): string
dismiss(): Promise<void>
message(): string
type(): Protocol.Page.DialogType