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 (windowsHide → CREATE_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.
System info
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 withoutwindowsHide, sochrome-headless-shell(a console-subsystem binary) gets a console window.Root cause
src/server/utils/processLauncher.jsbuildsspawnOptionswithdetachedbut neverwindowsHide:On Windows,
childProcess.spawnwithoutwindowsHide: trueallocates a console window (windowsHide→CREATE_NO_WINDOW).Fix
const spawnOptions = { detached: process.platform !== "win32", + windowsHide: true, env: options.env, cwd: options.cwd, shell: options.shell, stdio };Verification
Patched
processLauncher.jsinnode_moduleslocally, restarted — thechrome-headless-shellconsole window no longer appears (confirmed viaEnumWindows). Windows-only; no-op elsewhere.