From faea1d4791d68bfb1dbad1b447b05ab9b75e73a4 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Mon, 16 Oct 2023 05:55:04 -0400 Subject: [PATCH] =?UTF-8?q?refactor:=20use=20page().mainFrame()=20instead?= =?UTF-8?q?=20of=20manually=20computing=20the=20ro=E2=80=A6=20(#11166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/puppeteer-core/src/cdp/Frame.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/puppeteer-core/src/cdp/Frame.ts b/packages/puppeteer-core/src/cdp/Frame.ts index d0fc15ea14c..dd04878e273 100644 --- a/packages/puppeteer-core/src/cdp/Frame.ts +++ b/packages/puppeteer-core/src/cdp/Frame.ts @@ -292,11 +292,11 @@ export class CdpFrame extends Frame { } #deviceRequestPromptManager(): DeviceRequestPromptManager { - const parentFrame = this.parentFrame(); - if (this.isOOPFrame() || parentFrame === null) { + const rootFrame = this.page().mainFrame(); + if (this.isOOPFrame() || rootFrame === null) { return this._frameManager._deviceRequestPromptManager(this.#client); } else { - return parentFrame.#deviceRequestPromptManager(); + return rootFrame._frameManager._deviceRequestPromptManager(this.#client); } }