Skip to content

[Bug]: Windows console window pops up when launching chrome-headless-shell (processLauncher missing windowsHide) #41630

Description

@tomfluff

System info

  • Playwright: 1.58.2 (playwright-core)
  • OS: Windows 11 (10.0.26200)
  • Node: v22.23.1
  • Browser: Chromium (chrome-headless-shell, headless)

Summary

On Windows, launching Chromium opens a console window (a Windows Terminal window on Win11) for chrome-headless-shell.exe. The browser process is spawned without windowsHide, so chrome-headless-shell (a console-subsystem binary) gets a console window.

Root cause

src/server/utils/processLauncher.js builds spawnOptions with detached but never windowsHide:

const spawnOptions = {
  detached: process.platform !== "win32",
  env: options.env,
  cwd: options.cwd,
  shell: options.shell,
  stdio
};
const spawnedProcess = childProcess.spawn(options.command, options.args || [], spawnOptions);

On Windows, childProcess.spawn without windowsHide: true allocates a console window (windowsHideCREATE_NO_WINDOW).

Fix

   const spawnOptions = {
     detached: process.platform !== "win32",
+    windowsHide: true,
     env: options.env,
     cwd: options.cwd,
     shell: options.shell,
     stdio
   };

Verification

Patched processLauncher.js in node_modules locally, restarted — the chrome-headless-shell console window no longer appears (confirmed via EnumWindows). Windows-only; no-op elsewhere.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions