diff --git a/packages/puppeteer-core/src/api/Frame.ts b/packages/puppeteer-core/src/api/Frame.ts index 240fe78f962..f5fb88f10bb 100644 --- a/packages/puppeteer-core/src/api/Frame.ts +++ b/packages/puppeteer-core/src/api/Frame.ts @@ -394,13 +394,9 @@ export abstract class Frame extends EventEmitter { */ #document(): Promise> { if (!this.#_document) { - this.#_document = this.isolatedRealm() - .evaluateHandle(() => { - return document; - }) - .then(handle => { - return this.mainRealm().transferHandle(handle); - }); + this.#_document = this.mainRealm().evaluateHandle(() => { + return document; + }); } return this.#_document; }