From ed92453071bd78afba26a832c179bca3fa915e0e Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Thu, 16 Apr 2026 20:40:32 -0400 Subject: [PATCH] fix(browse): respect GSTACK_CHROMIUM_PATH in headless mode GSTACK_CHROMIUM_PATH was only read in launchHeaded() but not in launch(). Skills like /qa that use headless mode ignored the env var, breaking browse on NixOS and other non-FHS distros where the bundled chromium_headless_shell binary fails. Read the env var in launch() the same way launchHeaded() does and pass it as executablePath to chromium.launch(). Fixes #906 --- browse/src/browser-manager.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browse/src/browser-manager.ts b/browse/src/browser-manager.ts index 6b9242da9e..2b056058fc 100644 --- a/browse/src/browser-manager.ts +++ b/browse/src/browser-manager.ts @@ -180,12 +180,15 @@ export class BrowserManager { console.log(`[browse] Extensions loaded from: ${extensionsDir}`); } + const executablePath = process.env.GSTACK_CHROMIUM_PATH || undefined; + this.browser = await chromium.launch({ headless: useHeadless, // On Windows, Chromium's sandbox fails when the server is spawned through // the Bun→Node process chain (GitHub #276). Disable it — local daemon // browsing user-specified URLs has marginal sandbox benefit. chromiumSandbox: process.platform !== 'win32', + ...(executablePath ? { executablePath } : {}), ...(launchArgs.length > 0 ? { args: launchArgs } : {}), });