function preLaunchChrome
preLaunchChrome(
chromePath: string | null | undefined,
args: string[]
): Promise<EarlyChrome | null>

Spawns a headless Chrome process with remote-debugging-port=0 and resolves once the CDP WebSocket endpoint is printed to stderr. Returns null if Chrome is unavailable or fails to start, so callers can fall back to playwright's normal launch.

Parameters

chromePath: string | null | undefined
args: string[]

Return Type

Promise<EarlyChrome | null>

| null>}

Usage

import preLaunchChrome from "lib/utils/pre-launch-chrome.ts";