2026-02-23 19:57:19 +01:00
|
|
|
/**
|
|
|
|
|
* Shared types for cloakbrowser launch wrappers.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export interface LaunchOptions {
|
|
|
|
|
/** Run in headless mode (default: true). */
|
|
|
|
|
headless?: boolean;
|
2026-03-04 20:11:30 +01:00
|
|
|
/**
|
|
|
|
|
* Proxy server — URL string or Playwright proxy object.
|
|
|
|
|
* String: 'http://user:pass@proxy:8080' (credentials auto-extracted).
|
|
|
|
|
* Object: { server: "http://proxy:8080", bypass: ".google.com", ... }
|
|
|
|
|
* — passed directly to Playwright.
|
|
|
|
|
*/
|
|
|
|
|
proxy?: string | { server: string; bypass?: string; username?: string; password?: string };
|
2026-02-23 19:57:19 +01:00
|
|
|
/** Additional Chromium CLI arguments. */
|
|
|
|
|
args?: string[];
|
|
|
|
|
/** Include default stealth fingerprint args (default: true). Set false to use custom --fingerprint flags. */
|
|
|
|
|
stealthArgs?: boolean;
|
2026-03-02 18:20:57 +01:00
|
|
|
/** IANA timezone, e.g. "America/New_York". Sets --fingerprint-timezone binary flag. */
|
2026-03-01 01:07:11 +01:00
|
|
|
timezone?: string;
|
|
|
|
|
/** BCP 47 locale, e.g. "en-US". Sets --lang binary flag. */
|
|
|
|
|
locale?: string;
|
|
|
|
|
/** Auto-detect timezone/locale from proxy IP (requires: npm install mmdb-lib). */
|
|
|
|
|
geoip?: boolean;
|
2026-02-23 19:57:19 +01:00
|
|
|
/** Raw options passed directly to playwright/puppeteer launch(). */
|
|
|
|
|
launchOptions?: Record<string, unknown>;
|
2026-03-08 12:49:42 +03:00
|
|
|
/** Enable human-like mouse, keyboard, and scroll behavior. */
|
|
|
|
|
humanize?: boolean;
|
|
|
|
|
/** Human behavior preset: 'default' or 'careful'. */
|
|
|
|
|
humanPreset?: 'default' | 'careful';
|
|
|
|
|
/** Override individual human behavior parameters. */
|
|
|
|
|
humanConfig?: Record<string, unknown>;
|
2026-02-23 19:57:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface LaunchContextOptions extends LaunchOptions {
|
|
|
|
|
/** Custom user agent string. */
|
|
|
|
|
userAgent?: string;
|
|
|
|
|
/** Viewport size. */
|
2026-04-07 11:11:44 +08:00
|
|
|
viewport?: { width: number; height: number } | null;
|
2026-02-23 19:57:19 +01:00
|
|
|
/** Browser locale, e.g. "en-US". */
|
|
|
|
|
locale?: string;
|
2026-03-10 03:29:38 +01:00
|
|
|
/** IANA timezone — alias for `timezone`. Either works. */
|
2026-02-23 19:57:19 +01:00
|
|
|
timezoneId?: string;
|
2026-03-01 02:21:53 +01:00
|
|
|
/** Color scheme preference — 'light', 'dark', or 'no-preference'. */
|
|
|
|
|
colorScheme?: "light" | "dark" | "no-preference";
|
2026-02-23 19:57:19 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-04 12:31:33 +03:00
|
|
|
export interface LaunchPersistentContextOptions extends LaunchContextOptions {
|
2026-03-04 12:00:49 +03:00
|
|
|
/** Path to user data directory for persistent profile. */
|
|
|
|
|
userDataDir: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-23 19:57:19 +01:00
|
|
|
export interface BinaryInfo {
|
|
|
|
|
version: string;
|
|
|
|
|
platform: string;
|
|
|
|
|
binaryPath: string;
|
|
|
|
|
installed: boolean;
|
|
|
|
|
cacheDir: string;
|
|
|
|
|
downloadUrl: string;
|
|
|
|
|
}
|