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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user