camoucore 0.3.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -3
- package/dist/camoufox/__main__.d.ts +10 -0
- package/dist/camoufox/__main__.js +1175 -0
- package/dist/camoufox/__version__.d.ts +31 -0
- package/dist/camoufox/__version__.js +32 -0
- package/dist/camoufox/_humanize_playwright.d.ts +54 -0
- package/dist/camoufox/_humanize_playwright.js +429 -0
- package/dist/camoufox/addons.d.ts +21 -0
- package/dist/camoufox/addons.js +56 -0
- package/dist/camoufox/async_api.d.ts +9 -0
- package/dist/camoufox/async_api.js +9 -0
- package/dist/camoufox/browser-pin.d.ts +46 -0
- package/dist/camoufox/browser-pin.js +96 -0
- package/dist/camoufox/cli.d.ts +7 -0
- package/dist/camoufox/cli.js +20 -0
- package/dist/camoufox/coherence.d.ts +141 -0
- package/dist/camoufox/coherence.js +708 -0
- package/dist/camoufox/data-files/audio-output-latency.json +15 -0
- package/dist/camoufox/data-files/browser-pin.json +7 -0
- package/dist/camoufox/data-files/display-profiles.json +6 -0
- package/dist/camoufox/data-files/essential-fonts.json +5 -0
- package/dist/camoufox/data-files/fingerprint-presets-v150.json +14544 -0
- package/dist/camoufox/data-files/fingerprint-presets.json +5192 -0
- package/dist/camoufox/data-files/font-bases.json +1888 -0
- package/dist/camoufox/data-files/font-groups.json +716 -0
- package/dist/camoufox/data-files/font-prefs.json +1046 -0
- package/dist/camoufox/data-files/fonts.json +240 -0
- package/dist/camoufox/data-files/fpgen.yml +44 -0
- package/dist/camoufox/data-files/launcher-constants.json +136 -0
- package/dist/camoufox/data-files/media-devices.json +180 -0
- package/dist/camoufox/data-files/repos.yml +40 -0
- package/dist/camoufox/data-files/voice-manifests.json +1864 -0
- package/dist/camoufox/data-files/voice-uris.json +188 -0
- package/dist/camoufox/data-files/warnings.yml +146 -0
- package/dist/camoufox/display_profile.d.ts +21 -0
- package/dist/camoufox/display_profile.js +129 -0
- package/dist/camoufox/driver_defaults.d.ts +27 -0
- package/dist/camoufox/driver_defaults.js +119 -0
- package/dist/camoufox/exceptions.d.ts +68 -0
- package/dist/camoufox/exceptions.js +122 -0
- package/dist/camoufox/fingerprints.d.ts +434 -0
- package/dist/camoufox/fingerprints.js +1936 -0
- package/dist/camoufox/gpudisplay.d.ts +158 -0
- package/dist/camoufox/gpudisplay.js +695 -0
- package/dist/camoufox/host_rendering.d.ts +38 -0
- package/dist/camoufox/host_rendering.js +180 -0
- package/dist/camoufox/humanize.d.ts +89 -0
- package/dist/camoufox/humanize.js +143 -0
- package/dist/camoufox/index.d.ts +21 -0
- package/dist/camoufox/index.js +21 -0
- package/dist/camoufox/ip.d.ts +45 -0
- package/dist/camoufox/ip.js +114 -0
- package/dist/camoufox/multiversion.d.ts +131 -0
- package/dist/camoufox/multiversion.js +490 -0
- package/dist/camoufox/node-floor.d.ts +5 -0
- package/dist/camoufox/node-floor.js +17 -0
- package/dist/camoufox/paths.d.ts +45 -0
- package/dist/camoufox/paths.js +62 -0
- package/dist/camoufox/pkgman.d.ts +361 -0
- package/dist/camoufox/pkgman.js +1066 -0
- package/dist/camoufox/product.d.ts +8 -0
- package/dist/camoufox/product.js +8 -0
- package/dist/camoufox/pycompat.d.ts +97 -0
- package/dist/camoufox/pycompat.js +458 -0
- package/dist/camoufox/server.d.ts +36 -0
- package/dist/camoufox/server.js +82 -0
- package/dist/camoufox/sync_api.d.ts +77 -0
- package/dist/camoufox/sync_api.js +207 -0
- package/dist/camoufox/utils.d.ts +638 -0
- package/dist/camoufox/utils.js +2507 -0
- package/dist/camoufox/warnings.d.ts +16 -0
- package/dist/camoufox/warnings.js +65 -0
- package/dist/camoufox/webgl.d.ts +52 -0
- package/dist/camoufox/webgl.js +264 -0
- package/dist/camouwolf/__main__.d.ts +10 -0
- package/dist/camouwolf/__main__.js +1180 -0
- package/dist/camouwolf/__version__.d.ts +31 -0
- package/dist/camouwolf/__version__.js +32 -0
- package/dist/camouwolf/_humanize_playwright.d.ts +53 -0
- package/dist/camouwolf/_humanize_playwright.js +427 -0
- package/dist/camouwolf/addons.d.ts +42 -0
- package/dist/camouwolf/addons.js +113 -0
- package/dist/camouwolf/async_api.d.ts +9 -0
- package/dist/camouwolf/async_api.js +9 -0
- package/dist/camouwolf/browser-pin.d.ts +46 -0
- package/dist/camouwolf/browser-pin.js +96 -0
- package/dist/camouwolf/cli.d.ts +7 -0
- package/dist/camouwolf/cli.js +20 -0
- package/dist/camouwolf/clienthints.d.ts +61 -0
- package/dist/camouwolf/clienthints.js +176 -0
- package/dist/camouwolf/coherence.d.ts +152 -0
- package/dist/camouwolf/coherence.js +554 -0
- package/dist/camouwolf/data-files/browser-pin.json +7 -0
- package/dist/camouwolf/data-files/camouwolf.defaults.json +118 -0
- package/dist/camouwolf/data-files/data/bundle-fonts.json +1983 -0
- package/dist/camouwolf/data-files/data/chrome-languages.json +517 -0
- package/dist/camouwolf/data-files/data/properties.json +321 -0
- package/dist/camouwolf/data-files/data/system-colors.json +35 -0
- package/dist/camouwolf/data-files/data/ubo.json +6 -0
- package/dist/camouwolf/data-files/fpgen.yml +41 -0
- package/dist/camouwolf/data-files/launcher-constants.json +26 -0
- package/dist/camouwolf/data-files/repos.yml +23 -0
- package/dist/camouwolf/data-files/warnings.yml +96 -0
- package/dist/camouwolf/driver_defaults.d.ts +25 -0
- package/dist/camouwolf/driver_defaults.js +114 -0
- package/dist/camouwolf/exceptions.d.ts +95 -0
- package/dist/camouwolf/exceptions.js +150 -0
- package/dist/camouwolf/fingerprints.d.ts +227 -0
- package/dist/camouwolf/fingerprints.js +753 -0
- package/dist/camouwolf/gpudisplay.d.ts +171 -0
- package/dist/camouwolf/gpudisplay.js +711 -0
- package/dist/camouwolf/host_rendering.d.ts +18 -0
- package/dist/camouwolf/host_rendering.js +114 -0
- package/dist/camouwolf/humanize.d.ts +84 -0
- package/dist/camouwolf/humanize.js +128 -0
- package/dist/camouwolf/index.d.ts +22 -0
- package/dist/camouwolf/index.js +21 -0
- package/dist/camouwolf/multiversion.d.ts +131 -0
- package/dist/camouwolf/multiversion.js +491 -0
- package/dist/camouwolf/node-floor.d.ts +5 -0
- package/dist/camouwolf/node-floor.js +17 -0
- package/dist/camouwolf/paths.d.ts +34 -0
- package/dist/camouwolf/paths.js +58 -0
- package/dist/camouwolf/pkgman.d.ts +331 -0
- package/dist/camouwolf/pkgman.js +972 -0
- package/dist/camouwolf/product.d.ts +3 -0
- package/dist/camouwolf/product.js +3 -0
- package/dist/camouwolf/pycompat.d.ts +92 -0
- package/dist/camouwolf/pycompat.js +461 -0
- package/dist/camouwolf/server.d.ts +36 -0
- package/dist/camouwolf/server.js +81 -0
- package/dist/camouwolf/switches.d.ts +77 -0
- package/dist/camouwolf/switches.js +222 -0
- package/dist/camouwolf/sync_api.d.ts +84 -0
- package/dist/camouwolf/sync_api.js +173 -0
- package/dist/camouwolf/utils.d.ts +644 -0
- package/dist/camouwolf/utils.js +2057 -0
- package/dist/camouwolf/warnings.d.ts +14 -0
- package/dist/camouwolf/warnings.js +59 -0
- package/dist/camouwolf/webgl.d.ts +41 -0
- package/dist/camouwolf/webgl.js +198 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.js +3 -3
- package/dist/download.js +1 -1
- package/dist/exceptions.d.ts +1 -1
- package/dist/exceptions.js +1 -1
- package/dist/geolocation.js +1 -1
- package/dist/host.js +1 -1
- package/dist/ip.js +1 -1
- package/dist/locales.js +1 -1
- package/dist/mcp/cli.d.ts +15 -0
- package/dist/mcp/cli.js +108 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/main.d.ts +2 -0
- package/dist/mcp/main.js +8 -0
- package/dist/mcp/secrets.d.ts +50 -0
- package/dist/mcp/secrets.js +193 -0
- package/dist/mcp/server.d.ts +48 -0
- package/dist/mcp/server.js +653 -0
- package/dist/mcp/tree.d.ts +10 -0
- package/dist/mcp/tree.js +36 -0
- package/dist/passthrough.d.ts +1 -1
- package/dist/product.js +1 -1
- package/dist/settings.js +1 -1
- package/dist/telemetry.d.ts +0 -1
- package/dist/telemetry.js +5 -4
- package/dist/virtdisplay.d.ts +1 -1
- package/dist/virtdisplay.js +1 -1
- package/dist/warnings.js +1 -1
- package/package.json +57 -13
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
import { hasDisplay, largestDisplay } from "../display.js";
|
|
2
|
+
import { geoipAllowed, getGeolocation } from "../geolocation.js";
|
|
3
|
+
import { type ProxyConfig, publicIP, publicIPv6 } from "../ip.js";
|
|
4
|
+
import { VirtualDisplay } from "../virtdisplay.js";
|
|
5
|
+
import { addDefaultAddons, confirmPaths, type DefaultAddon } from "./addons.js";
|
|
6
|
+
import * as clienthints from "./clienthints.js";
|
|
7
|
+
import * as coherence from "./coherence.js";
|
|
8
|
+
import { generateFingerprint, type HostCpu, Screen } from "./fingerprints.js";
|
|
9
|
+
import { selectGpu } from "./gpudisplay.js";
|
|
10
|
+
import { type HumanizeSetting } from "./humanize.js";
|
|
11
|
+
import { ensureBrowserProfileDir, ensureCamouwolfInstalled, launchPath, selectedLaunchPath, warnIfPackageOutdated } from "./pkgman.js";
|
|
12
|
+
import { chromeGpus } from "./webgl.js";
|
|
13
|
+
type ListOrString = string | readonly string[];
|
|
14
|
+
type Config = Record<string, any>;
|
|
15
|
+
export type TargetOS = clienthints.OsKey;
|
|
16
|
+
export type OsName = "windows" | "macos" | "linux";
|
|
17
|
+
export type EnvVars = Record<string, string | number | boolean | undefined>;
|
|
18
|
+
/** System colours of each OS's default theme, by OS name. */
|
|
19
|
+
export declare const SYSTEM_COLORS: Readonly<Record<string, Record<string, number>>>;
|
|
20
|
+
/**
|
|
21
|
+
* What this host can pass for. A Linux build can render as Windows (the
|
|
22
|
+
* bundled Windows fonts, the UCRT math replica, patches 0019 and 0022);
|
|
23
|
+
* nothing makes a Linux or Windows host render as macOS, or a Windows or macOS
|
|
24
|
+
* host as Linux.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ALLOWED_OS_TARGETS: Readonly<Record<TargetOS, readonly OsName[]>>;
|
|
27
|
+
/**
|
|
28
|
+
* How many fingerprints to draw before giving up on one whose GPU the identity
|
|
29
|
+
* can claim. fpgen's GPU condition already excludes software renderers, so a
|
|
30
|
+
* redraw only happens for a record whose ANGLE backend its own OS never uses.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MAX_FINGERPRINT_DRAWS = 20;
|
|
33
|
+
export declare const FONT_FILE_SUFFIXES: readonly string[];
|
|
34
|
+
/** What the launch reads from the host; the tests replace these. */
|
|
35
|
+
export declare const utilsDeps: {
|
|
36
|
+
osName: () => TargetOS;
|
|
37
|
+
installDir: () => string;
|
|
38
|
+
/** os.environ, for CAMOUWOLF_EXECUTABLE_PATH and the default `env`. */
|
|
39
|
+
environ: () => NodeJS.ProcessEnv;
|
|
40
|
+
hasDisplay: typeof hasDisplay;
|
|
41
|
+
largestDisplay: typeof largestDisplay;
|
|
42
|
+
/** Overrides for the host CPU probes of fixHardwareConcurrency. */
|
|
43
|
+
hostCpu: () => HostCpu;
|
|
44
|
+
print: (line: string) => void;
|
|
45
|
+
ensureBrowserProfileDir: typeof ensureBrowserProfileDir;
|
|
46
|
+
ensureCamouwolfInstalled: typeof ensureCamouwolfInstalled;
|
|
47
|
+
warnIfPackageOutdated: typeof warnIfPackageOutdated;
|
|
48
|
+
addDefaultAddons: typeof addDefaultAddons;
|
|
49
|
+
confirmPaths: typeof confirmPaths;
|
|
50
|
+
installedVerStr: () => string;
|
|
51
|
+
launchPath: typeof launchPath;
|
|
52
|
+
selectedLaunchPath: typeof selectedLaunchPath;
|
|
53
|
+
/** fpgen's model is fetched on first use, like Python's. */
|
|
54
|
+
ensureModel: () => Promise<void>;
|
|
55
|
+
generateFingerprint: typeof generateFingerprint;
|
|
56
|
+
chromeGpus: typeof chromeGpus;
|
|
57
|
+
publicIp: typeof publicIP;
|
|
58
|
+
publicIpv6: typeof publicIPv6;
|
|
59
|
+
geoipAllowed: typeof geoipAllowed;
|
|
60
|
+
getGeolocation: typeof getGeolocation;
|
|
61
|
+
selectGpu: typeof selectGpu;
|
|
62
|
+
/** secrets.randbelow(2**32 - 1) + 1 */
|
|
63
|
+
canvasSeed: () => number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* orjson.dumps(config): compact, UTF-8, insertion order. JavaScript has one
|
|
67
|
+
* number type, so the Python int/float split is carried the way pycompat
|
|
68
|
+
* carries it: a safe-integer number is an int, a bigint is an int beyond
|
|
69
|
+
* 2**53, a PyFloat is an integral float, and any other number is a float.
|
|
70
|
+
*/
|
|
71
|
+
export declare function configJson(value: unknown): string;
|
|
72
|
+
/**
|
|
73
|
+
* A runtime fontconfig for an identity on `osDir` ('linux', 'macos',
|
|
74
|
+
* 'windows'), from the bundle beside the binary; null when the bundle ships no
|
|
75
|
+
* fonts for that OS.
|
|
76
|
+
*
|
|
77
|
+
* The bundled fonts.conf names its font directory relative to the working
|
|
78
|
+
* directory, which breaks when the launcher runs anywhere else, so a copy with
|
|
79
|
+
* absolute paths is written to the cache directory (not into the bundle, which
|
|
80
|
+
* is commonly read-only at launch). Loaded through FONTCONFIG_FILE it is the
|
|
81
|
+
* only config: the host's /etc/fonts rules, and so the host's fonts, are not
|
|
82
|
+
* read.
|
|
83
|
+
*/
|
|
84
|
+
export declare function generateFontconfig(executablePath: string, osDir: string): string | null;
|
|
85
|
+
/**
|
|
86
|
+
* The config as CAMOU_CONFIG_1..N environment variables.
|
|
87
|
+
*
|
|
88
|
+
* Windows limits one variable to 32767 characters and, through some launch
|
|
89
|
+
* paths, to 2047, so the JSON is split there; elsewhere at 32767.
|
|
90
|
+
*/
|
|
91
|
+
export declare function configEnvVars(configMap: Config, chunkSize?: number | null): Record<string, string>;
|
|
92
|
+
/**
|
|
93
|
+
* Gets the environment variables for Camouwolf: the config, and what the
|
|
94
|
+
* identity's OS needs from the process environment.
|
|
95
|
+
*
|
|
96
|
+
* `executablePath` is the executable about to launch; its bundle's fontconfig
|
|
97
|
+
* is used.
|
|
98
|
+
*/
|
|
99
|
+
export declare function getEnvVars(configMap: Config, userAgentOs: TargetOS, executablePath?: string | null): Record<string, string>;
|
|
100
|
+
/**
|
|
101
|
+
* Validates the config map: every key must be one the browser reads, with a
|
|
102
|
+
* value of its type. An unknown key throws UnknownProperty.
|
|
103
|
+
*/
|
|
104
|
+
export declare function validateConfig(configMap: Config, executablePath?: string | null): void;
|
|
105
|
+
/**
|
|
106
|
+
* Every entry is a decimal pname and a scalar, or a list of 2 to 4 numbers
|
|
107
|
+
* (the typed arrays getParameter returns); the browser reads nothing else.
|
|
108
|
+
*/
|
|
109
|
+
export declare function validateWebglParameters(key: string, parameters: Config): void;
|
|
110
|
+
/** Validates the type of the value. */
|
|
111
|
+
export declare function validateType(value: unknown, expectedType: string): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Gets the OS from the config if the user agent is set, otherwise returns the
|
|
114
|
+
* OS of the current system.
|
|
115
|
+
*/
|
|
116
|
+
export declare function getTargetOs(config: Config): TargetOS;
|
|
117
|
+
/** Checks if the target OS is valid. */
|
|
118
|
+
export declare function checkValidOs(osValue: ListOrString): void;
|
|
119
|
+
/** Refuse an identity on an OS this host cannot pass for. */
|
|
120
|
+
export declare function checkOsPolicy(names: readonly string[], allowOsMismatch?: boolean | null): void;
|
|
121
|
+
/**
|
|
122
|
+
* Merges new keys/values from the source into the target, given that the key
|
|
123
|
+
* does not exist in the target.
|
|
124
|
+
*/
|
|
125
|
+
export declare function mergeInto(target: Config, source: Config): void;
|
|
126
|
+
/** Checks if a domain is set in the config. */
|
|
127
|
+
export declare function isDomainSet(config: Config, ...properties: string[]): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Warns for each coherence violation the launch left in place because the
|
|
130
|
+
* caller set the values involved. Camouwolf does not overwrite what the caller
|
|
131
|
+
* passed, but an identity no real machine presents is detectable.
|
|
132
|
+
*/
|
|
133
|
+
export declare function warnKeptIncoherent(violations: coherence.Violation[]): void;
|
|
134
|
+
/**
|
|
135
|
+
* Warns the user if they are manually setting properties that Camouwolf
|
|
136
|
+
* already sets internally.
|
|
137
|
+
*/
|
|
138
|
+
export declare function warnManualConfig(config: Config): void;
|
|
139
|
+
/**
|
|
140
|
+
* Asserts that the passed fingerprint is a Chrome fingerprint, and warns the
|
|
141
|
+
* user that passing their own fingerprint is not recommended.
|
|
142
|
+
*/
|
|
143
|
+
export declare function checkCustomFingerprint(fingerprint: Config): void;
|
|
144
|
+
/**
|
|
145
|
+
* The Chromium version ('152.0.7977.42') of the build about to launch.
|
|
146
|
+
*
|
|
147
|
+
* The named executable's own version.json, or what the binary answers to
|
|
148
|
+
* --version; the installed release when no executable is named. A build that
|
|
149
|
+
* states no version throws, since claiming another build's would leak in the
|
|
150
|
+
* user agent and the client hints.
|
|
151
|
+
*/
|
|
152
|
+
export declare function resolveVersion(executablePath?: string | null): string;
|
|
153
|
+
/**
|
|
154
|
+
* What the build claims to be: "chromium" for the public build, "chrome" for
|
|
155
|
+
* one built with Chrome emulation (version.json's `product`).
|
|
156
|
+
*/
|
|
157
|
+
export declare function buildProduct(executablePath: string): string;
|
|
158
|
+
/**
|
|
159
|
+
* The navigator.keyboard.getLayoutMap() of a US QWERTY keyboard on the target
|
|
160
|
+
* OS, as "code=key" entries. null on macOS, where the host's map is left as it
|
|
161
|
+
* is.
|
|
162
|
+
*/
|
|
163
|
+
export declare function keyboardLayoutMap(targetOs: string): string[] | null;
|
|
164
|
+
/** Chrome's default language list per first language (data/chrome-languages.json). */
|
|
165
|
+
export declare const CHROME_LANGUAGES: {
|
|
166
|
+
readonly fallback: string;
|
|
167
|
+
readonly lists: Readonly<Record<string, string[]>>;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* The language list for a resolved locale: every listed locale, or Chrome's
|
|
171
|
+
* own default list for the primary one (data/chrome-languages.json).
|
|
172
|
+
*
|
|
173
|
+
* The default is the list an off-the-record profile serves whatever the user
|
|
174
|
+
* set, so a Playwright context and a persistent one claim the same list.
|
|
175
|
+
*/
|
|
176
|
+
export declare function languagesFor(localeConfig: Config): string[] | null;
|
|
177
|
+
/**
|
|
178
|
+
* Merge `prefs` into the profile's Default/Preferences file.
|
|
179
|
+
*
|
|
180
|
+
* Keys are Chromium's dotted pref paths ("credentials_enable_service",
|
|
181
|
+
* "profile.default_content_setting_values.notifications") or nested objects; a
|
|
182
|
+
* dotted key is expanded into the nested form Chromium stores.
|
|
183
|
+
*/
|
|
184
|
+
export declare function writeChromiumPrefs(userDataDir: string, prefs: Config): string;
|
|
185
|
+
/** The CAMOU_CONFIG_<n> chunks of a set of launch options, joined in order. */
|
|
186
|
+
export declare function camouConfigBlob(fromOptions: Config): string;
|
|
187
|
+
/** The config a set of launch options carries in its environment. */
|
|
188
|
+
export declare function launchConfig(fromOptions: Config): Config;
|
|
189
|
+
/**
|
|
190
|
+
* The OS ('macos', 'windows' or 'linux') of the identity these launch options
|
|
191
|
+
* claim, the host's when they claim no user agent.
|
|
192
|
+
*/
|
|
193
|
+
export declare function launchOs(fromOptions: Config): OsName;
|
|
194
|
+
export interface GeolocationOption {
|
|
195
|
+
latitude: number;
|
|
196
|
+
longitude: number;
|
|
197
|
+
accuracy?: number;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Whether these launch options are a passthrough launch's: every drawn
|
|
201
|
+
* identity claims a user agent, and a passthrough launch draws none.
|
|
202
|
+
*/
|
|
203
|
+
export declare function launchIsPassthrough(fromOptions: Config): boolean;
|
|
204
|
+
/**
|
|
205
|
+
* The position these launch options place the browser at, as Playwright's
|
|
206
|
+
* `geolocation` option, or null.
|
|
207
|
+
*/
|
|
208
|
+
export declare function launchGeolocation(fromOptions: Config): GeolocationOption | null;
|
|
209
|
+
/**
|
|
210
|
+
* The position an identity places its browser at, as Playwright's
|
|
211
|
+
* `geolocation` option, or null.
|
|
212
|
+
*/
|
|
213
|
+
export declare function geolocationOf(config: Config): GeolocationOption | null;
|
|
214
|
+
/**
|
|
215
|
+
* The core count the browser must be pinned to for these launch options, or
|
|
216
|
+
* null: the identity's navigator.hardwareConcurrency when this host can honour
|
|
217
|
+
* it (see cpu_affinity), so a page measuring parallelism sees the reported
|
|
218
|
+
* number.
|
|
219
|
+
*/
|
|
220
|
+
export declare function pinnedCoreCount(fromOptions: Config): number | null;
|
|
221
|
+
/**
|
|
222
|
+
* PID of the process that will spawn the browser (its children inherit the
|
|
223
|
+
* CPU affinity set on it). Python's driver is a separate Node process;
|
|
224
|
+
* playwright-core runs in this one.
|
|
225
|
+
*/
|
|
226
|
+
export declare function driverPid(): number;
|
|
227
|
+
/**
|
|
228
|
+
* Playwright emulates four media features on every context it creates, whether
|
|
229
|
+
* or not the caller asked: `colorScheme` defaults to "light" and reducedMotion
|
|
230
|
+
* / forcedColors / contrast to their no-preference values. That is an
|
|
231
|
+
* override, not a passthrough: the page then reports it whatever the host is
|
|
232
|
+
* set to. `null` is Playwright's own opt-out (Python's "no-override"): it
|
|
233
|
+
* sends no emulation at all and the browser answers for itself.
|
|
234
|
+
*/
|
|
235
|
+
export declare const STOCK_MEDIA_DEFAULTS: {
|
|
236
|
+
readonly colorScheme: null;
|
|
237
|
+
readonly reducedMotion: null;
|
|
238
|
+
readonly forcedColors: null;
|
|
239
|
+
readonly contrast: null;
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* Playwright context options that would make one context's pages a different
|
|
243
|
+
* machine from its workers and request headers, which answer from the
|
|
244
|
+
* context's identity whatever Playwright emulates in a page. Named as Playwright's JS API names
|
|
245
|
+
* them (Python: user_agent, is_mobile, device_scale_factor, screen, has_touch).
|
|
246
|
+
*/
|
|
247
|
+
export declare const PER_CONTEXT_IDENTITY_OPTIONS: Readonly<Record<string, string>>;
|
|
248
|
+
/**
|
|
249
|
+
* The context options in `options` that would make a context's pages disagree
|
|
250
|
+
* with its identity, each with the reason.
|
|
251
|
+
*/
|
|
252
|
+
export declare function perContextIdentityProblems(options: Config): string[];
|
|
253
|
+
/**
|
|
254
|
+
* Throw IncoherentIdentity for a context option that would make a context's
|
|
255
|
+
* pages disagree with its identity.
|
|
256
|
+
*/
|
|
257
|
+
export declare function refusePerContextIdentity(options: Config): void;
|
|
258
|
+
/**
|
|
259
|
+
* The adjustment every newPage()/newContext() of a Camouwolf browser gets.
|
|
260
|
+
*
|
|
261
|
+
* - no viewport: Playwright's default 1280x720 viewport is a device-metrics
|
|
262
|
+
* override, which replaces the window size the identity launched with and
|
|
263
|
+
* reports the viewport as the screen. Without it the page reads the real
|
|
264
|
+
* window. A caller's `viewport` wins.
|
|
265
|
+
* - the host's own media features instead of Playwright's emulated ones.
|
|
266
|
+
* - the launch's geolocation (geoip, or geolocation:* in config), granted, as
|
|
267
|
+
* a browser whose user chose "Always allow" has it.
|
|
268
|
+
* - a LeakWarning for an option its pages would answer with against the
|
|
269
|
+
* context's identity (NewContext refuses those outright), unless the
|
|
270
|
+
* launch is passthrough.
|
|
271
|
+
*
|
|
272
|
+
* Returns the adjusted copy of the options.
|
|
273
|
+
*/
|
|
274
|
+
export declare function contextDefaults(geolocation: GeolocationOption | null | undefined, passthrough?: boolean): (options?: Config) => Config;
|
|
275
|
+
/**
|
|
276
|
+
* Patch 0031 sends a proxied context's WebRTC through the proxy; this keeps it
|
|
277
|
+
* to TCP there, with no UDP at all.
|
|
278
|
+
*/
|
|
279
|
+
export declare const WEBRTC_BLOCK_SWITCH = "--force-webrtc-ip-handling-policy=disable_non_proxied_udp";
|
|
280
|
+
/**
|
|
281
|
+
* Camoufox's NewContext options that would name another browser build than the
|
|
282
|
+
* one running, which every context shares.
|
|
283
|
+
*/
|
|
284
|
+
export declare const OTHER_BUILD_OPTIONS: readonly string[];
|
|
285
|
+
/**
|
|
286
|
+
* Whether this host has a public IPv6 address that geolocates where the IPv4
|
|
287
|
+
* identity does. Warns when it has one that does not.
|
|
288
|
+
*/
|
|
289
|
+
export declare function keepsIpv6(geoConfig: Config, geoipDb: string | undefined, iKnowWhatImDoing: boolean | undefined): Promise<boolean>;
|
|
290
|
+
/**
|
|
291
|
+
* Throw for a NewContext option a context cannot take: NotImplementedError for
|
|
292
|
+
* a Camoufox one naming another browser build than the one every context runs
|
|
293
|
+
* in, IncoherentIdentity for one its pages would contradict.
|
|
294
|
+
*/
|
|
295
|
+
export declare function refuseContextOptions(contextOptions: Config): void;
|
|
296
|
+
/** The language list these launch options give the browser. */
|
|
297
|
+
export declare function launchLanguages(fromOptions: Config): string[] | null;
|
|
298
|
+
/**
|
|
299
|
+
* The Chromium version the launch's identity claims: the binary's, or the
|
|
300
|
+
* chrome_version milestone the launch was given.
|
|
301
|
+
*/
|
|
302
|
+
export declare function launchFullVersion(fromOptions: Config): string;
|
|
303
|
+
/** What NewContext draws a context's identity from. */
|
|
304
|
+
export interface ContextIdentityOptions {
|
|
305
|
+
proxy?: ProxyConfig | null;
|
|
306
|
+
os?: string | null;
|
|
307
|
+
fingerprint?: Record<string, any> | null;
|
|
308
|
+
config?: Config | null;
|
|
309
|
+
webgl_config?: [string, string] | null;
|
|
310
|
+
webrtc_ip?: string | null;
|
|
311
|
+
fonts?: string[] | null;
|
|
312
|
+
custom_fonts_only?: boolean | null;
|
|
313
|
+
locale?: string | string[] | null;
|
|
314
|
+
timezoneId?: string | null;
|
|
315
|
+
i_know_what_im_doing?: boolean | null;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Keys of the browser rather than of a machine, which a context keeps from the
|
|
319
|
+
* launch: its renderers read the context's config in place of the launch's.
|
|
320
|
+
*/
|
|
321
|
+
export declare const BROWSER_KEYS: readonly ["network:ipv4Only", "allowAddonNewtab", "instantAnimations", "showcursor"];
|
|
322
|
+
/**
|
|
323
|
+
* A context's own identity and language list, drawn for the browser that
|
|
324
|
+
* `fromOptions` launched.
|
|
325
|
+
*
|
|
326
|
+
* The machine is drawn afresh on the launch's OS, screen, window and core
|
|
327
|
+
* count, which one browser process cannot vary. A proxied context is placed
|
|
328
|
+
* where the proxy exits, looked up through it; any other leaves from the
|
|
329
|
+
* browser's address and so keeps the launch's place and languages.
|
|
330
|
+
*/
|
|
331
|
+
export declare function contextIdentity(fromOptions: Config, { proxy, os, fingerprint, config: callerConfig, webgl_config, webrtc_ip, fonts, custom_fonts_only, locale, timezoneId, i_know_what_im_doing, }?: ContextIdentityOptions): Promise<{
|
|
332
|
+
identity: Config;
|
|
333
|
+
languages: string[];
|
|
334
|
+
}>;
|
|
335
|
+
/**
|
|
336
|
+
* The newContext() options NewContext passes for a context with `identity`:
|
|
337
|
+
* the caller's, placed where the identity is.
|
|
338
|
+
*/
|
|
339
|
+
export declare function newContextOptions(contextOptions: Config, identity: Config, proxy?: ProxyConfig | null, geolocation?: GeolocationOption | null): Config;
|
|
340
|
+
/** Target.setBrowserContextIdentity's parameters (patch 0034). */
|
|
341
|
+
export declare function setContextIdentityParams(contextId: string, identity: Config, languages: string[]): Config;
|
|
342
|
+
/**
|
|
343
|
+
* The one browser context Target.getBrowserContexts lists in `after` and not
|
|
344
|
+
* in `before`.
|
|
345
|
+
*/
|
|
346
|
+
export declare function createdContextId(before: Config, after: Config): string;
|
|
347
|
+
/**
|
|
348
|
+
* Launch options for launchPersistentContext(). The launch itself creates the
|
|
349
|
+
* context, so the defaults newContext() would get go into the options.
|
|
350
|
+
*/
|
|
351
|
+
export declare function persistentContextOptions(fromOptions: Config): Config;
|
|
352
|
+
/**
|
|
353
|
+
* Warn that a non-persistent launch carries extensions its contexts will not
|
|
354
|
+
* run.
|
|
355
|
+
*/
|
|
356
|
+
export declare function warnAddonsWithoutProfile(fromOptions: Config): void;
|
|
357
|
+
/**
|
|
358
|
+
* Give every newPage()/newContext() of `browser` Camouwolf's defaults, and keep
|
|
359
|
+
* the launch options NewContext draws a context's identity to fit.
|
|
360
|
+
*/
|
|
361
|
+
export declare function attachContextDefaults<T>(browser: T, fromOptions: Config): T;
|
|
362
|
+
/**
|
|
363
|
+
* `options` with each one the caller left unset taken from the defaults file,
|
|
364
|
+
* overlaid with the user's own.
|
|
365
|
+
*/
|
|
366
|
+
export declare function launchDefaults<T extends Record<string, unknown>>(options: T): T;
|
|
367
|
+
/**
|
|
368
|
+
* Count anti-bot outcomes on every context of `target` (a Browser, or a
|
|
369
|
+
* persistent BrowserContext) when telemetry is on; see camoucore's telemetry
|
|
370
|
+
* for what is sent. Telemetry never fails a launch.
|
|
371
|
+
*/
|
|
372
|
+
export declare function startTelemetry(target: any, fromOptions: Config, setting: boolean | null | undefined, persistent: boolean): void;
|
|
373
|
+
/** The launch options a Camouwolf browser was launched with. */
|
|
374
|
+
export declare function launchOptionsOf(browser: unknown): Config;
|
|
375
|
+
/** The headless modes NewBrowser and launchServer accept. */
|
|
376
|
+
export type Headless = boolean | "virtual" | "virtual-gpu";
|
|
377
|
+
/** The options of the display headless="virtual-gpu" starts. */
|
|
378
|
+
export interface GpuDisplayOptions {
|
|
379
|
+
/** The GPU for headless="virtual-gpu": an index, a render or card node, a
|
|
380
|
+
* PCI address, vendor:device ids or a vendor name. Defaults to
|
|
381
|
+
* $CAMOUWOLF_GPU, or the host's only GPU. */
|
|
382
|
+
gpu?: string | number;
|
|
383
|
+
/** Fail the launch (the default) when the browser on the GPU display does
|
|
384
|
+
* not render on the GPU; false warns instead. */
|
|
385
|
+
require_gpu?: boolean;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Start the display headless="virtual" or "virtual-gpu" asks for.
|
|
389
|
+
*
|
|
390
|
+
* Takes the display's own options out of `options` and points the launch at
|
|
391
|
+
* the display. Returns the display, or null, and the headless value to launch
|
|
392
|
+
* with.
|
|
393
|
+
*/
|
|
394
|
+
export declare function startVirtualDisplay(headless: Headless | undefined | null, debug: boolean | undefined | null, options: LaunchOptions & GpuDisplayOptions): Promise<[VirtualDisplay | null, boolean | undefined | null]>;
|
|
395
|
+
/**
|
|
396
|
+
* Attaches the virtual display to the browser's cleanup, and on a GPU display
|
|
397
|
+
* checks the browser renders on the GPU. (Python has an async and a sync
|
|
398
|
+
* variant; playwright-core has one API.)
|
|
399
|
+
*/
|
|
400
|
+
export declare function attachVirtualDisplay<T>(browser: T, virtualDisplay?: VirtualDisplay | null): Promise<T>;
|
|
401
|
+
/** A bound on the screen a generated fingerprint may claim. */
|
|
402
|
+
export type ScreenConstraint = Screen | {
|
|
403
|
+
min_width?: number;
|
|
404
|
+
max_width?: number;
|
|
405
|
+
min_height?: number;
|
|
406
|
+
max_height?: number;
|
|
407
|
+
minWidth?: number;
|
|
408
|
+
maxWidth?: number;
|
|
409
|
+
minHeight?: number;
|
|
410
|
+
maxHeight?: number;
|
|
411
|
+
};
|
|
412
|
+
/** An fpgen condition on navigator.languages: the first is `language`'s. */
|
|
413
|
+
/** A Camoufox-format preset's OS, GPU and recorded config values. */
|
|
414
|
+
export interface PresetIdentity {
|
|
415
|
+
os: OsName;
|
|
416
|
+
webglConfig: [string, string];
|
|
417
|
+
config: Config;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* The OS, GPU and recorded values of a Camoufox-format preset recorded from
|
|
421
|
+
* Chrome. Its user agent names only the OS: the version is the binary's.
|
|
422
|
+
*/
|
|
423
|
+
export declare function presetIdentity(preset: unknown): PresetIdentity;
|
|
424
|
+
/** The OSes in `os` that have `cpu`; ValueError when none does. */
|
|
425
|
+
export declare function osesForCpu(cpu: unknown, os: ListOrString): ListOrString;
|
|
426
|
+
export declare const SOCKS5_DEFAULT_PORT = 1080;
|
|
427
|
+
/**
|
|
428
|
+
* The "host:port" the browser looks a SOCKS5 proxy's credentials up by: the
|
|
429
|
+
* proxy's canonical host and port, as net::HostPortPair prints them.
|
|
430
|
+
*/
|
|
431
|
+
export declare function socks5ProxyKey(server: string): string;
|
|
432
|
+
/**
|
|
433
|
+
* A socks5 proxy without its credentials, for Playwright (which refuses them
|
|
434
|
+
* for Chromium), and the credentials as proxy:socks5Credentials, which the
|
|
435
|
+
* browser reads from its config rather than from argv.
|
|
436
|
+
*/
|
|
437
|
+
export declare function splitSocks5Credentials(proxy: ProxyConfig | null | undefined): [ProxyConfig | null | undefined, Config | null];
|
|
438
|
+
/** The config with proxy credentials masked, for printing. */
|
|
439
|
+
export declare function maskedConfig(config: Config): Config;
|
|
440
|
+
/**
|
|
441
|
+
* Move certificatePaths into certificates: each file's certificates, PEM or
|
|
442
|
+
* DER, as the base64 DER the browser trusts.
|
|
443
|
+
*/
|
|
444
|
+
export declare function readCertificatePaths(config: Config): void;
|
|
445
|
+
export declare function speaks(language: string): (value: unknown) => boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Draw an fpgen Chrome fingerprint whose GPU the identity may claim.
|
|
448
|
+
*
|
|
449
|
+
* Without `webglConfig`, any recorded hardware GPU on a backend its OS uses.
|
|
450
|
+
* With it, a record of exactly that device: its limits, screen and fonts are
|
|
451
|
+
* then the ones a machine with that GPU reported.
|
|
452
|
+
*
|
|
453
|
+
* With `language`, a record of Chrome in that language where fpgen has one:
|
|
454
|
+
* a machine's voices and fonts follow the language its OS was installed in.
|
|
455
|
+
*/
|
|
456
|
+
export declare function drawFingerprint(os: ListOrString | null | undefined, screen: Screen | null | undefined, window: readonly [number, number] | null | undefined, webglConfig: readonly [string, string] | null | undefined, language?: string, cpu?: Record<string, string> | null): Promise<Config>;
|
|
457
|
+
export interface LaunchOptions {
|
|
458
|
+
/** Camouwolf properties to use; they win over generated values. An unknown
|
|
459
|
+
* key throws UnknownProperty (see data/properties.json). */
|
|
460
|
+
config?: Record<string, any>;
|
|
461
|
+
/** Operating system of the identity: "windows", "macos", "linux", or a list
|
|
462
|
+
* to choose from. Defaults to what this host can pass for: its own OS, and
|
|
463
|
+
* Windows on a Linux host. Another OS throws UnsupportedOSSpoof unless
|
|
464
|
+
* `allow_os_mismatch` is true. */
|
|
465
|
+
os?: string | string[];
|
|
466
|
+
/** Whether to block all images. */
|
|
467
|
+
block_images?: boolean;
|
|
468
|
+
/** Keep WebRTC to TCP through the proxy, with no UDP. Without it, a
|
|
469
|
+
* proxied launch's WebRTC is a machine's at the proxy's exit: UDP goes
|
|
470
|
+
* through a SOCKS5 proxy's relay, and through no other proxy. */
|
|
471
|
+
block_webrtc?: boolean;
|
|
472
|
+
/** Whether to block WebGL. To prevent leaks, only use this for special cases. */
|
|
473
|
+
block_webgl?: boolean;
|
|
474
|
+
/** Ignore Cross-Origin-Opener-Policy headers, so a popup a COOP page opens
|
|
475
|
+
* keeps its opener. A COOP page is then not crossOriginIsolated, which it
|
|
476
|
+
* can read, so it warns. */
|
|
477
|
+
disable_coop?: boolean;
|
|
478
|
+
/** Finish every finite CSS and Web Animation at once. A page reads the zero
|
|
479
|
+
* duration back, so it warns. */
|
|
480
|
+
instant_animations?: boolean;
|
|
481
|
+
/** Show where automation clicks, with DevTools' click visualization: a
|
|
482
|
+
* ripple at each mouse or pointer press, painted in the overlay a page
|
|
483
|
+
* cannot read. Screenshots and a watched window show it. */
|
|
484
|
+
show_cursor?: boolean;
|
|
485
|
+
/** Use a specific WebGL vendor/renderer pair. It must be one fpgen has
|
|
486
|
+
* recorded from Chrome on `os` (chromeGpus); the whole identity is then
|
|
487
|
+
* drawn from a machine with that GPU. */
|
|
488
|
+
webgl_config?: [string, string];
|
|
489
|
+
/** The CPU the identity claims: {arch: "x86" | "arm", manufacturer}, either
|
|
490
|
+
* key optional (a manufacturer implies its arch). It is Sec-CH-UA-Arch, and
|
|
491
|
+
* the GPU is drawn from machines with that CPU. Manufacturers: windows x86
|
|
492
|
+
* intel or amd, arm qualcomm; macos x86 intel, arm apple; linux x86 intel or
|
|
493
|
+
* amd. The browser still computes as the host's x86-64 CPU does. */
|
|
494
|
+
cpu?: Record<string, string>;
|
|
495
|
+
/** Calculate longitude, latitude, timezone, country & locale from the IP
|
|
496
|
+
* address. Pass the target IP, or `true` to find it automatically. */
|
|
497
|
+
geoip?: string | boolean;
|
|
498
|
+
/** Name of the GeoIP database to use (e.g. "GeoIP AIO by daijro"). */
|
|
499
|
+
geoip_db?: string;
|
|
500
|
+
/** Driver-side humanization. Applied by Camouwolf()/NewBrowser(); only
|
|
501
|
+
* validated here. */
|
|
502
|
+
humanize?: HumanizeSetting;
|
|
503
|
+
/** Locale(s) to use. The first is the browser's UI and Intl locale; all of
|
|
504
|
+
* them are navigator.languages and the Accept-Language header. One locale
|
|
505
|
+
* claims Chrome's default list for it ("de-DE" is de-DE, de, en-US, en). A
|
|
506
|
+
* non-persistent context serves that default for the first of a longer
|
|
507
|
+
* list, as Chrome does off the record. */
|
|
508
|
+
locale?: string | string[];
|
|
509
|
+
/** Unpacked Chrome extensions (directories holding a manifest.json). */
|
|
510
|
+
addons?: string[];
|
|
511
|
+
/** Font families to report installed, in addition to the identity's own. */
|
|
512
|
+
fonts?: string[];
|
|
513
|
+
/** Report only `fonts` installed, without the identity's own. */
|
|
514
|
+
custom_fonts_only?: boolean;
|
|
515
|
+
/** Default addons to exclude. */
|
|
516
|
+
exclude_addons?: DefaultAddon[];
|
|
517
|
+
/** Constrains the screen dimensions of the generated fingerprint. */
|
|
518
|
+
screen?: ScreenConstraint;
|
|
519
|
+
/** Set a fixed outer window size instead of the fingerprint's. */
|
|
520
|
+
window?: [number, number];
|
|
521
|
+
/** An fpgen Chrome fingerprint to use instead of drawing one. */
|
|
522
|
+
fingerprint?: Record<string, any>;
|
|
523
|
+
/** A device recorded from real Chrome, in Camoufox's preset format
|
|
524
|
+
* ({navigator: {userAgent, hardwareConcurrency, maxTouchPoints}, screen:
|
|
525
|
+
* {width, height, colorDepth, availWidth, availHeight, devicePixelRatio},
|
|
526
|
+
* webgl: {unmaskedVendor, unmaskedRenderer}, timezone}). The rest is drawn
|
|
527
|
+
* from an fpgen record of a machine with that GPU, and the version is the
|
|
528
|
+
* binary's. `true` throws ValueError: no Chrome presets are bundled. */
|
|
529
|
+
fingerprint_preset?: boolean | Record<string, any>;
|
|
530
|
+
/** Chromium milestone to claim. Defaults to the browser's own; another one
|
|
531
|
+
* disagrees with what the binary can do, and warns. */
|
|
532
|
+
chrome_version?: number;
|
|
533
|
+
/** Camoufox's option; throws NotImplementedError naming chrome_version. */
|
|
534
|
+
ff_version?: number;
|
|
535
|
+
/** Whether to run Chromium's own headless mode. Defaults to false. */
|
|
536
|
+
headless?: boolean | null;
|
|
537
|
+
/** Accepted for Camoufox compatibility; nothing to switch on. */
|
|
538
|
+
main_world_eval?: boolean;
|
|
539
|
+
/** Let extensions open tabs and windows of their own (chrome.tabs.create,
|
|
540
|
+
* chrome.windows.create, an options page). Off by default, so automation
|
|
541
|
+
* sees only the pages it opened. */
|
|
542
|
+
allow_addon_new_tab?: boolean;
|
|
543
|
+
/** Custom Camouwolf browser executable path. CAMOUWOLF_EXECUTABLE_PATH in
|
|
544
|
+
* the environment does the same. */
|
|
545
|
+
executable_path?: string;
|
|
546
|
+
/** Select a specific installed browser version ("official/alpha.1", ...). */
|
|
547
|
+
browser?: string;
|
|
548
|
+
/** Chromium preferences, merged into the profile's Preferences file before
|
|
549
|
+
* launch. Needs a persistent context (`user_data_dir`). */
|
|
550
|
+
chromium_prefs?: Record<string, any>;
|
|
551
|
+
/** Camoufox's option; throws NotImplementedError. */
|
|
552
|
+
firefox_user_prefs?: Record<string, any>;
|
|
553
|
+
/** Proxy to use for the browser. A socks5:// proxy may carry a username
|
|
554
|
+
* and password: the browser answers the proxy's RFC 1929 challenge with
|
|
555
|
+
* them. They travel in the config's environment variables, never on the
|
|
556
|
+
* command line. */
|
|
557
|
+
proxy?: ProxyConfig;
|
|
558
|
+
/** Keep the HTTP disk cache. Off by default. */
|
|
559
|
+
enable_cache?: boolean;
|
|
560
|
+
/** Arguments to pass to the browser. */
|
|
561
|
+
args?: string[];
|
|
562
|
+
/** Environment variables to set. */
|
|
563
|
+
env?: EnvVars;
|
|
564
|
+
/** Silence warnings, and drop conflicting switches instead of refusing them. */
|
|
565
|
+
i_know_what_im_doing?: boolean;
|
|
566
|
+
/** Prints the config being sent to Camouwolf, with proxy credentials
|
|
567
|
+
* masked, and has the browser log to stderr (--enable-logging=stderr). */
|
|
568
|
+
debug?: boolean | null;
|
|
569
|
+
/**
|
|
570
|
+
* Virtual display number. Ex: ':99'. Handled by Camouwolf(), which passes
|
|
571
|
+
* a display not yet started; it is sized to the identity and started here.
|
|
572
|
+
*/
|
|
573
|
+
virtual_display?: string | VirtualDisplay;
|
|
574
|
+
/**
|
|
575
|
+
* The virtual display's size in device pixels; the identity's screen, at
|
|
576
|
+
* its devicePixelRatio, is kept within it.
|
|
577
|
+
*/
|
|
578
|
+
virtual_display_size?: [number, number];
|
|
579
|
+
/** Keep the fingerprint's own core count by pinning the browser to that
|
|
580
|
+
* many cores. Off by default: the host's count is reported. */
|
|
581
|
+
pin_cpu_cores?: boolean;
|
|
582
|
+
/** Perturb canvas readback with a per-identity seed. Off by default. */
|
|
583
|
+
canvas_noise?: boolean | null;
|
|
584
|
+
/** Allow an identity on an OS this host cannot pass for. */
|
|
585
|
+
allow_os_mismatch?: boolean;
|
|
586
|
+
/** Launch with this machine's own fingerprint: no identity is drawn and no
|
|
587
|
+
* identity config, font set, timezone, window size or language is sent.
|
|
588
|
+
* Behaviour options still apply. An identity option (os, locale, geoip,
|
|
589
|
+
* config, ...) alongside it throws. */
|
|
590
|
+
passthrough?: boolean;
|
|
591
|
+
/** Report anonymous anti-bot outcome counts per proxy provider (see the
|
|
592
|
+
* README). Applied by Camouwolf()/NewBrowser(); CAMOUWOLF_TELEMETRY=0 or
|
|
593
|
+
* DO_NOT_TRACK=1 turns it off too. */
|
|
594
|
+
telemetry?: boolean;
|
|
595
|
+
/** Additional Playwright Chromium launch options. */
|
|
596
|
+
[key: string]: any;
|
|
597
|
+
}
|
|
598
|
+
/** What drawIdentity draws an identity from. */
|
|
599
|
+
export interface DrawIdentityOptions {
|
|
600
|
+
os?: ListOrString | null;
|
|
601
|
+
webgl_config?: [string, string] | null;
|
|
602
|
+
geoip?: string | boolean | null;
|
|
603
|
+
geoip_db?: string;
|
|
604
|
+
proxy?: ProxyConfig | null;
|
|
605
|
+
block_webrtc?: boolean | null;
|
|
606
|
+
locale?: string | string[] | null;
|
|
607
|
+
fingerprint?: Record<string, any> | null;
|
|
608
|
+
screen?: Screen | null;
|
|
609
|
+
window?: [number, number];
|
|
610
|
+
fonts?: string[] | null;
|
|
611
|
+
custom_fonts_only?: boolean | null;
|
|
612
|
+
canvas_noise?: boolean | null;
|
|
613
|
+
pin_cpu_cores?: boolean | null;
|
|
614
|
+
fullVersion: string;
|
|
615
|
+
allow_os_mismatch?: boolean;
|
|
616
|
+
i_know_what_im_doing?: boolean;
|
|
617
|
+
browserBinary: string;
|
|
618
|
+
displayBound?: Screen | null;
|
|
619
|
+
virtualDisplay?: boolean;
|
|
620
|
+
/** The browser's own config: given, this is a context's identity. */
|
|
621
|
+
launch?: Config;
|
|
622
|
+
cpu?: Record<string, string> | null;
|
|
623
|
+
/** A preset's values: they stand as a caller's would, except the core count. */
|
|
624
|
+
recorded?: Config | null;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* A whole identity, drawn into `config`: its language list and its OS.
|
|
628
|
+
*
|
|
629
|
+
* `config` holds the caller's keys, which win over drawn ones. With `launch`
|
|
630
|
+
* (the browser's own config) it is a context's identity: the screen, window
|
|
631
|
+
* and core count are the launch's, which one browser process cannot vary.
|
|
632
|
+
*/
|
|
633
|
+
export declare function drawIdentity(config: Config, { os: osOption, webgl_config, geoip, geoip_db, proxy, block_webrtc, locale, fingerprint, screen, window, fonts, custom_fonts_only, canvas_noise, pin_cpu_cores, fullVersion, allow_os_mismatch, i_know_what_im_doing, browserBinary, displayBound, virtualDisplay, launch, cpu, recorded, }: DrawIdentityOptions): Promise<{
|
|
634
|
+
languages: string[] | null;
|
|
635
|
+
targetOs: clienthints.OsKey;
|
|
636
|
+
}>;
|
|
637
|
+
/**
|
|
638
|
+
* Builds the Playwright launch options for a Camouwolf browser. Accepts all
|
|
639
|
+
* Playwright Chromium launch options, along with those of LaunchOptions. An
|
|
640
|
+
* option left unset takes its value from camouwolf.defaults.json and the
|
|
641
|
+
* user's own defaults file (`camouwolf defaults`).
|
|
642
|
+
*/
|
|
643
|
+
export declare function launchOptions(options?: LaunchOptions): Promise<Record<string, any>>;
|
|
644
|
+
export {};
|