diff --git a/packages/puppeteer-core/src/api/Dialog.ts b/packages/puppeteer-core/src/api/Dialog.ts index ff70eec4881..352337f30f8 100644 --- a/packages/puppeteer-core/src/api/Dialog.ts +++ b/packages/puppeteer-core/src/api/Dialog.ts @@ -76,7 +76,7 @@ export abstract class Dialog { /** * @internal */ - protected abstract sendCommand(options: { + protected abstract handle(options: { accept: boolean; text?: string; }): Promise; @@ -91,7 +91,7 @@ export abstract class Dialog { async accept(promptText?: string): Promise { assert(!this.#handled, 'Cannot accept dialog which is already handled!'); this.#handled = true; - await this.sendCommand({ + await this.handle({ accept: true, text: promptText, }); @@ -103,7 +103,7 @@ export abstract class Dialog { async dismiss(): Promise { assert(!this.#handled, 'Cannot dismiss dialog which is already handled!'); this.#handled = true; - await this.sendCommand({ + await this.handle({ accept: false, }); } diff --git a/packages/puppeteer-core/src/bidi/Dialog.ts b/packages/puppeteer-core/src/bidi/Dialog.ts index 4bf741cc4ea..ce222234614 100644 --- a/packages/puppeteer-core/src/bidi/Dialog.ts +++ b/packages/puppeteer-core/src/bidi/Dialog.ts @@ -32,7 +32,7 @@ export class BidiDialog extends Dialog { /** * @internal */ - override async sendCommand(options: { + override async handle(options: { accept: boolean; text?: string; }): Promise { diff --git a/packages/puppeteer-core/src/cdp/Dialog.ts b/packages/puppeteer-core/src/cdp/Dialog.ts index 77ea8aa4506..fe8fffbcad9 100644 --- a/packages/puppeteer-core/src/cdp/Dialog.ts +++ b/packages/puppeteer-core/src/cdp/Dialog.ts @@ -25,7 +25,7 @@ export class CdpDialog extends Dialog { this.#client = client; } - override async sendCommand(options: { + override async handle(options: { accept: boolean; text?: string; }): Promise {