launch(config: LaunchTarget,skipPrelaunch?: boolean): Promise<Browser>
Launches a browser for the given config.browser type.
For chromium: connects via CDP to the pre-launched Chrome (fast path) or falls
back to chromium.launch() if pre-launch failed.
For firefox/webkit: uses playwright's standard launch (requires npx playwright install [browser]).
import * as Browser from './browser.ts'; import type { Config } from '../types.ts'; // Defined, not invoked: connects to / launches a real browser. async function example(config: Config) { const browser = await Browser.launch(config); // chromium: CDP fast path, else playwright launch() return browser.newPage(); }
config: LaunchTarget