From f39c9ff0f54af3dce395bf068d377e358ba3aec1 Mon Sep 17 00:00:00 2001 From: aryansk Date: Sun, 23 Aug 2026 19:02:22 +0530 Subject: [PATCH] Fix Windows console window for chrome-headless-shell Every 'npx hyperframes render' on Windows flashed a visible CMD window for each shot (78 windows for 78 shots). chrome-headless-shell is a console-subsystem binary, so Node's spawn shows a console window unless windowsHide:true (CREATE_NO_WINDOW) is set. Puppeteer-core's launch spawns the browser via child_process.spawn without windowsHide by default. Add windowsHide:true to all puppeteer.launch sites so the browser is hidden on Windows. Fixes #3430 --- packages/cli/src/beats/headlessAnalyzer.ts | 2 ++ packages/cli/src/capture/captureCompositionFrame.ts | 2 ++ packages/cli/src/capture/index.ts | 2 ++ packages/cli/src/commands/layout.ts | 2 ++ packages/cli/src/commands/motionShot.ts | 2 ++ packages/cli/src/commands/validate.ts | 2 ++ packages/engine/src/services/browserManager.ts | 12 ++++++++++-- packages/producer/src/parity-harness.ts | 2 ++ packages/studio/vite.browser.ts | 2 ++ 9 files changed, 26 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/beats/headlessAnalyzer.ts b/packages/cli/src/beats/headlessAnalyzer.ts index e532955bfd..cc189419eb 100644 --- a/packages/cli/src/beats/headlessAnalyzer.ts +++ b/packages/cli/src/beats/headlessAnalyzer.ts @@ -140,6 +140,8 @@ export async function analyzeBeatsHeadless(audioBytes: Buffer): Promise { const unavailable = { hasWebGL: false, vendor: "", renderer: "" }; @@ -701,7 +705,11 @@ async function launchBrowser( executablePath: fingerprint.executablePath, timeout: fingerprint.browserTimeoutMs, protocolTimeout: fingerprint.protocolTimeoutMs, - }); + // Prevent visible console window on Windows for console-subsystem + // chrome-headless-shell.exe (see #3430). + // @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430) + windowsHide: true, + } as any); const browserVersion = await browser.version().catch(() => "unknown"); const gpuFlags = fingerprint.args.filter( diff --git a/packages/producer/src/parity-harness.ts b/packages/producer/src/parity-harness.ts index e390ac81f8..3b29ad6cd9 100644 --- a/packages/producer/src/parity-harness.ts +++ b/packages/producer/src/parity-harness.ts @@ -314,6 +314,8 @@ async function run(): Promise { const browser = await puppeteer.launch({ ...browserTarget, headless: true, + // @ts-ignore -- windowsHide not in PuppeteerLaunchOptions but forwarded to spawn on Windows (see #3430) + windowsHide: true, defaultViewport: { width: options.width, height: options.height, diff --git a/packages/studio/vite.browser.ts b/packages/studio/vite.browser.ts index d2c06a9873..a614859b4e 100644 --- a/packages/studio/vite.browser.ts +++ b/packages/studio/vite.browser.ts @@ -103,6 +103,8 @@ async function getSharedBrowser(): Promise