diff --git a/browse/src/browser-manager.ts b/browse/src/browser-manager.ts index f9f3317b5..5c1a81a4e 100644 --- a/browse/src/browser-manager.ts +++ b/browse/src/browser-manager.ts @@ -369,6 +369,16 @@ export class BrowserManager { console.log(`[browse] Extensions loaded from: ${extensionsDir}`); } + // Windows: the default headless path launches chrome-headless-shell.exe — a + // CONSOLE-subsystem binary that pops a terminal window on every launch. Switch + // to Chrome's "new" headless (full chrome.exe, GUI-subsystem → no console + // window) by launching non-headless with --headless=new. Other platforms keep + // the lighter headless shell (they have no console-window problem). + if (process.platform === 'win32' && useHeadless) { + launchArgs.push('--headless=new'); + useHeadless = false; + } + this.browser = await chromium.launch({ headless: useHeadless, // On Windows, Chromium's sandbox fails when the server is spawned through diff --git a/browse/src/cli.ts b/browse/src/cli.ts index 59327b792..b4b70b1fb 100644 --- a/browse/src/cli.ts +++ b/browse/src/cli.ts @@ -323,9 +323,11 @@ async function startServer(extraEnv?: Record): Promise