/** * Locates a browser to run Lighthouse audits in. * * `chrome-launcher` only looks for Google Chrome and Chromium. Plenty of people * run Arc, Brave or Edge and have no Chrome at all — for them every audit * failed with "No Chrome installations found", losing four of the fifteen tools * with no hint that a different browser would do. * * Any Chromium-based browser can serve, since Lighthouse only needs a DevTools * protocol endpoint. Preference runs from closest-to-stock outwards, because * the more a fork customises its UI the likelier a headless run is to surprise. */ export declare class NoBrowserError extends Error { constructor(message: string); } export interface BrowserCandidate { name: string; path: string; } export interface FoundBrowser extends BrowserCandidate { /** How it was located, for diagnostics. */ source: "CHROME_PATH" | "chrome-launcher" | "known-install"; } /** * Chromium forks worth trying, best first. Ordering matters: a stock-ish build * behaves most predictably under Lighthouse, and Arc customises the most. */ export declare const CHROMIUM_CANDIDATES: readonly BrowserCandidate[]; /** * Tried only once everything else is exhausted. * * Arc replaces much of Chromium's window and tab handling, so it is the most * likely to behave unexpectedly headless. It is still far better than failing * outright for someone who has nothing else installed. */ export declare const LAST_RESORT_CANDIDATES: readonly BrowserCandidate[]; export interface FindOptions { env?: NodeJS.ProcessEnv; exists?: (candidate: string) => boolean; /** chrome-launcher's own detection, injected so this stays testable. */ installed?: () => string[]; /** Additional paths to consider before the known forks. */ extraCandidates?: BrowserCandidate[]; } export declare function findAuditBrowser(options?: FindOptions): FoundBrowser; /** * Explains a browser that was found but would not start. * * Lighthouse reports this as a bare "connect ECONNREFUSED ", because from * its side the debugging port simply never opened. That tells a user nothing. */ export declare function describeLaunchFailure(browser: FoundBrowser, cause: string): string;