/** * Browser extension injection support. * * Chrome extensions require a persistent profile directory — incompatible * with headless Docker by default. This module handles: * 1. Persistent profile directory per extension set * 2. Extension download from .crx URL or load from local path * 3. Launch args for Playwright / Stagehand * * Usage: * const profile = await prepareExtensionProfile(['/path/to/ext.crx']); * // pass profile.userDataDir and profile.args to browser launch */ export interface ExtensionSource { /** Local .crx file path or https:// URL to download from */ source: string; /** Friendly name for logging */ name?: string; } export interface ExtensionProfile { /** Chrome user-data-dir containing Preferences + extension unpacked dirs */ userDataDir: string; /** Args to append to chromium launch — includes --load-extension and --disable-extensions-except */ args: string[]; /** Cleanup the profile directory when done */ cleanup: () => Promise; } /** * Prepare a Chrome user-data-dir with the given extensions loaded. * Returns profile info + cleanup function. */ export declare function prepareExtensionProfile(extensions: ExtensionSource[]): Promise; /** * Ad-blocker extension profile using the uBlock Origin CRX. * Reduces noise from ad networks during crawls. */ export declare function adBlockerProfile(): Promise;