From 7703f7cfbfa084c4b4dcf1e7d607e2946bc24ffe Mon Sep 17 00:00:00 2001 From: shohu Date: Thu, 21 May 2026 08:10:15 +0900 Subject: [PATCH] fix(browse): mirror isCustomChromium() guard in headless launch() When BROWSE_EXTENSIONS_DIR is set alongside GSTACK_CHROMIUM_PATH pointing at a baked-extension build (GBrowser / GStack Browser), the headless launch() path was unconditionally adding --disable-extensions-except / --load-extension. This causes the same ServiceWorkerState::SetWorkerId DCHECK crash that launchHeaded() already guards against via isCustomChromium(). Mirror the existing guard: skip --load-extension flags when isCustomChromium() returns true; always push the off-screen window geometry args. --- browse/src/browser-manager.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/browse/src/browser-manager.ts b/browse/src/browser-manager.ts index b29d539c5..7734f0a62 100644 --- a/browse/src/browser-manager.ts +++ b/browse/src/browser-manager.ts @@ -307,12 +307,16 @@ export class BrowserManager { } if (extensionsDir) { - launchArgs.push( - `--disable-extensions-except=${extensionsDir}`, - `--load-extension=${extensionsDir}`, - '--window-position=-9999,-9999', - '--window-size=1,1', - ); + // Skip --load-extension when running against a custom Chromium build that + // already bakes the extension in (e.g., GBrowser / GStack Browser.app). + // Loading it twice causes a ServiceWorkerState::SetWorkerId DCHECK crash. + if (!isCustomChromium()) { + launchArgs.push( + `--disable-extensions-except=${extensionsDir}`, + `--load-extension=${extensionsDir}`, + ); + } + launchArgs.push('--window-position=-9999,-9999', '--window-size=1,1'); useHeadless = false; // extensions require headed mode; off-screen window simulates headless console.log(`[browse] Extensions loaded from: ${extensionsDir}`); }