Skip to content

Commit

Permalink
refactor: use page().mainFrame() instead of manually computing the ro…
Browse files Browse the repository at this point in the history
…ot frame

Bug: #11072
  • Loading branch information
thiagowfx committed Oct 16, 2023
1 parent 257be15 commit 2b435f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/puppeteer-core/src/cdp/Frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 2b435f8

Please sign in to comment.