mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-27 20:20:03 +02:00
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.
This commit is contained in:
@@ -307,12 +307,16 @@ export class BrowserManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (extensionsDir) {
|
if (extensionsDir) {
|
||||||
launchArgs.push(
|
// Skip --load-extension when running against a custom Chromium build that
|
||||||
`--disable-extensions-except=${extensionsDir}`,
|
// already bakes the extension in (e.g., GBrowser / GStack Browser.app).
|
||||||
`--load-extension=${extensionsDir}`,
|
// Loading it twice causes a ServiceWorkerState::SetWorkerId DCHECK crash.
|
||||||
'--window-position=-9999,-9999',
|
if (!isCustomChromium()) {
|
||||||
'--window-size=1,1',
|
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
|
useHeadless = false; // extensions require headed mode; off-screen window simulates headless
|
||||||
console.log(`[browse] Extensions loaded from: ${extensionsDir}`);
|
console.log(`[browse] Extensions loaded from: ${extensionsDir}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user