f
spawn(): Promise<EarlyChrome | null>
chromePath: string | null | undefined,
args: string[],
headless?: boolean,
onSpawn?: (handle: ChromeHandle) => void
Spawns a headless Chrome process with --remote-debugging-port=0 and resolves once the
CDP WebSocket endpoint appears on stderr. Returns null if Chrome is unavailable or fails
to start, so callers can fall back to playwright's normal chromium.launch().
Usage
import * as mod from "lib/chrome/spawn.ts";