From 775b2adda00e9deb95b2f1ece92c407fced7815e Mon Sep 17 00:00:00 2001 From: JunghwanNA <70629228+shaun0927@users.noreply.github.com> Date: Thu, 9 Apr 2026 10:33:26 +0900 Subject: [PATCH] fix(cookies): scope cookie bridge skip to pool pre-warming, not entire server mode Previously, server mode set skipCookieBridge globally via setGlobalConfig(), disabling cookie bridging for ALL page creations. This meant tab 2 would not inherit cookies from an authenticated tab 1 within the same session (issue #606). The skip was only needed for pool pre-warming (about:blank pages) to avoid CDP session conflicts. CDPConnectionPool.createNewPage() already passes skipCookieBridge=true per-call, so removing the global flag is safe. Co-Authored-By: Claude Sonnet 4.6 --- src/cdp/client.ts | 2 +- src/index.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cdp/client.ts b/src/cdp/client.ts index 2aac6cb..9b912b1 100644 --- a/src/cdp/client.ts +++ b/src/cdp/client.ts @@ -1288,7 +1288,7 @@ export class CDPClient { // Copy cookies from an authenticated page (skip for pool pre-warming to avoid // CDP session conflicts and unnecessary overhead on about:blank pages). - // Also skip when server mode sets skipCookieBridge globally. + // The global skipCookieBridge flag serves as a manual override escape hatch. // Overall timeout prevents cascading hangs from unresponsive source tabs. if (!skipCookieBridge && !getGlobalConfig().skipCookieBridge) { const authPageTargetId = await this.findAuthenticatedPageTargetId(targetDomain); diff --git a/src/index.ts b/src/index.ts index 6532683..e2dc566 100644 --- a/src/index.ts +++ b/src/index.ts @@ -130,10 +130,8 @@ program console.error(`[openchrome] Restart Chrome mode: enabled (will quit existing Chrome)`); } - // Apply server mode config (skip cookie bridge) - if (options.serverMode) { - setGlobalConfig({ skipCookieBridge: true }); - } + // Server mode: cookie bridge remains active for normal page creation. + // Pool pre-warming passes skipCookieBridge per-call to avoid CDP conflicts. // Configure hybrid mode if enabled const hybrid = options.hybrid || false;