Add Firefox cookie import and stealth mode
- Firefox cookie importer: reads cookies.sqlite with WAL-safe copy, profile detection via profiles.ini, cross-platform paths, domain filtering - Stealth mode: opt-in via launch(stealth: true), patches navigator.webdriver, plugins/mimeTypes, permissions API, WebGL renderer, iframe isolation, languages, plus realistic Safari UA and context hardening - Import tool now accepts 'safari' | 'firefox' source - STEALTH.md reference documentation - Upgraded @types/node to v25 for node:sqlite support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Firefox cookie importer
|
||||
*
|
||||
* Reads cookies from Firefox's cookies.sqlite database.
|
||||
* Firefox stores cookies as plain unencrypted SQLite — no binary parsing needed.
|
||||
*
|
||||
* Database schema (moz_cookies table):
|
||||
* id, originAttributes, name, value, host, path, expiry,
|
||||
* lastAccessed, creationTime, isSecure, isHttpOnly,
|
||||
* inBrowserElement, sameSite, rawSameSite, schemeMap
|
||||
*
|
||||
* Note: expiry is Unix seconds, but lastAccessed/creationTime are microseconds.
|
||||
*
|
||||
* Firefox holds an exclusive WAL lock while running, so we copy the database
|
||||
* files (cookies.sqlite + WAL + SHM) to a temp directory before reading.
|
||||
*/
|
||||
export interface FirefoxCookie {
|
||||
name: string;
|
||||
value: string;
|
||||
domain: string;
|
||||
path: string;
|
||||
expires: number;
|
||||
secure: boolean;
|
||||
httpOnly: boolean;
|
||||
sameSite: 'None' | 'Lax' | 'Strict';
|
||||
}
|
||||
interface FirefoxProfile {
|
||||
name: string;
|
||||
path: string;
|
||||
isRelative: boolean;
|
||||
isDefault: boolean;
|
||||
}
|
||||
/**
|
||||
* List available Firefox profiles
|
||||
*/
|
||||
export declare function listFirefoxProfiles(): FirefoxProfile[];
|
||||
/**
|
||||
* Import cookies from Firefox's cookies.sqlite database
|
||||
*/
|
||||
export declare function importFirefoxCookies(options?: {
|
||||
profile?: string;
|
||||
domain?: string;
|
||||
}): FirefoxCookie[];
|
||||
/**
|
||||
* Convert FirefoxCookie to Playwright cookie format
|
||||
*/
|
||||
export declare function toPlaywrightCookie(cookie: FirefoxCookie): {
|
||||
name: string;
|
||||
value: string;
|
||||
domain: string;
|
||||
path: string;
|
||||
expires: number;
|
||||
secure: boolean;
|
||||
httpOnly: boolean;
|
||||
sameSite: 'Strict' | 'Lax' | 'None';
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=firefox.d.ts.map
|
||||
Reference in New Issue
Block a user