From 3edce3aee9521654d7a285f4068a5e60bfb52245 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Mon, 23 Oct 2023 12:54:45 +0200 Subject: [PATCH] fix: remove circular import in IsolatedWorld (#11228) --- packages/puppeteer-core/src/cdp/IsolatedWorld.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/puppeteer-core/src/cdp/IsolatedWorld.ts b/packages/puppeteer-core/src/cdp/IsolatedWorld.ts index 7a0570c4..38309cb7 100644 --- a/packages/puppeteer-core/src/cdp/IsolatedWorld.ts +++ b/packages/puppeteer-core/src/cdp/IsolatedWorld.ts @@ -32,7 +32,7 @@ import {Mutex} from '../util/Mutex.js'; import type {Binding} from './Binding.js'; import {type ExecutionContext, createCdpHandle} from './ExecutionContext.js'; -import {CdpFrame} from './Frame.js'; +import type {CdpFrame} from './Frame.js'; import type {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js'; import type {WebWorker} from './WebWorker.js'; @@ -94,7 +94,7 @@ export class IsolatedWorld extends Realm { clearContext(): void { this.#context = Deferred.create(); - if (this.#frameOrWorker instanceof CdpFrame) { + if ('clearDocumentHandle' in this.#frameOrWorker) { this.#frameOrWorker.clearDocumentHandle(); } }