From 5f2ee98c5b93b0a52a98a1d8237189b8b0d15a10 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Wed, 12 Jun 2024 10:47:23 +0200 Subject: [PATCH] fix: do not wait for extension page targets on connect (#12574) --- packages/puppeteer-core/src/cdp/ChromeTargetManager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/puppeteer-core/src/cdp/ChromeTargetManager.ts b/packages/puppeteer-core/src/cdp/ChromeTargetManager.ts index e87d71fff91..ab22a0a1d13 100644 --- a/packages/puppeteer-core/src/cdp/ChromeTargetManager.ts +++ b/packages/puppeteer-core/src/cdp/ChromeTargetManager.ts @@ -122,10 +122,15 @@ export class ChromeTargetManager this, undefined ); + // Targets that will not be auto-attached. Therefore, we should + // not add them to #targetsIdsForInit. + const skipTarget = + targetInfo.type === 'browser' || + targetInfo.url.startsWith('chrome-extension://'); if ( (!this.#targetFilterCallback || this.#targetFilterCallback(targetForFilter)) && - targetInfo.type !== 'browser' + !skipTarget ) { this.#targetsIdsForInit.add(targetId); }