Functions

f
spawn(
chromePath: string | null | undefined,
args: string[],
headless?: boolean,
onSpawn?: (handle: ChromeHandle) => void
): Promise<EarlyChrome | null>

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";