mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
refactor: use page().mainFrame() instead of manually computing the ro… (#11166)
This commit is contained in:
parent
bb9ef6ee8b
commit
faea1d4791
@ -292,11 +292,11 @@ export class CdpFrame extends Frame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#deviceRequestPromptManager(): DeviceRequestPromptManager {
|
#deviceRequestPromptManager(): DeviceRequestPromptManager {
|
||||||
const parentFrame = this.parentFrame();
|
const rootFrame = this.page().mainFrame();
|
||||||
if (this.isOOPFrame() || parentFrame === null) {
|
if (this.isOOPFrame() || rootFrame === null) {
|
||||||
return this._frameManager._deviceRequestPromptManager(this.#client);
|
return this._frameManager._deviceRequestPromptManager(this.#client);
|
||||||
} else {
|
} else {
|
||||||
return parentFrame.#deviceRequestPromptManager();
|
return rootFrame._frameManager._deviceRequestPromptManager(this.#client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user