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,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whole-identity coherence: the checks that look at more than one field.
|
|
3
|
+
*
|
|
4
|
+
* An identity is assembled from several sources: an fpgen record, the client
|
|
5
|
+
* hints derived for the binary's milestone, the caller's own `config`, and the
|
|
6
|
+
* host (its core count, its display). A combination no machine has can be built
|
|
7
|
+
* from individually plausible parts: a Windows user agent beside a macOS
|
|
8
|
+
* Sec-CH-UA-Platform, a Direct3D renderer on a Linux identity, an Apple GPU
|
|
9
|
+
* behind an x86 Sec-CH-UA-Arch.
|
|
10
|
+
*
|
|
11
|
+
* Every identity passes through here on every launch, whatever it was built
|
|
12
|
+
* from. Each rule states an invariant that holds on real Chrome, says how to
|
|
13
|
+
* repair an identity that breaks it where a correct value is determined, and is
|
|
14
|
+
* checked again afterwards. `validate()` reports what is still broken;
|
|
15
|
+
* `apply()` repairs what it can.
|
|
16
|
+
*
|
|
17
|
+
* TypeScript twin of python/camoucore/src/camoucore/camouwolf/coherence.py.
|
|
18
|
+
*/
|
|
19
|
+
import * as clienthints from "./clienthints.js";
|
|
20
|
+
type Config = Record<string, any>;
|
|
21
|
+
type OsKey = clienthints.OsKey;
|
|
22
|
+
/**
|
|
23
|
+
* screen.colorDepth: Chrome reports 24, or 30 on a deep-colour display (most
|
|
24
|
+
* Macs). 32 appears in scraped data and is not a value Chrome emits.
|
|
25
|
+
*/
|
|
26
|
+
export declare const PLAUSIBLE_COLOR_DEPTH: ReadonlySet<number>;
|
|
27
|
+
/**
|
|
28
|
+
* navigator.deviceMemory is bucketed: a power of two, floored at 0.25 and
|
|
29
|
+
* capped (at 8 until Chrome 140, at 32 on desktop since).
|
|
30
|
+
*/
|
|
31
|
+
export declare const PLAUSIBLE_DEVICE_MEMORY: readonly number[];
|
|
32
|
+
/**
|
|
33
|
+
* navigator.hardwareConcurrency: at least one logical core, and no consumer
|
|
34
|
+
* machine has more than this.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MAX_PLAUSIBLE_CORES = 256;
|
|
37
|
+
/**
|
|
38
|
+
* Core counts Apple Silicon ships; Chrome reports every core, as there is no
|
|
39
|
+
* SMT. 9, 13 and 15 are not Apple parts, which is why this is a list.
|
|
40
|
+
*/
|
|
41
|
+
export declare const APPLE_SILICON_CORES: ReadonlySet<number>;
|
|
42
|
+
/**
|
|
43
|
+
* Logical core counts of Intel Macs whose WebGL runs on the integrated GPU, and
|
|
44
|
+
* with a discrete one, up to the 28-core Mac Pro. An eGPU can sit behind any.
|
|
45
|
+
*/
|
|
46
|
+
export declare const INTEL_MAC_IGP_CORES: ReadonlySet<number>;
|
|
47
|
+
export declare const INTEL_MAC_DGPU_CORES: ReadonlySet<number>;
|
|
48
|
+
/**
|
|
49
|
+
* window.devicePixelRatio: the scaling steps each OS's display settings offer.
|
|
50
|
+
* Scraped records also carry ratios such as 1.0909, which are a browser zoom
|
|
51
|
+
* folded into the display's scale.
|
|
52
|
+
*/
|
|
53
|
+
export declare const PLAUSIBLE_DPR: Readonly<Record<string, readonly number[]>>;
|
|
54
|
+
/** The CSS geometry a ratio scales: device pixels / devicePixelRatio. */
|
|
55
|
+
export declare const CSS_GEOMETRY_KEYS: readonly string[];
|
|
56
|
+
export interface Violation {
|
|
57
|
+
rule: string;
|
|
58
|
+
detail: string;
|
|
59
|
+
/**
|
|
60
|
+
* The caller's own keys that the repair would have changed, and which were
|
|
61
|
+
* kept as passed instead. Empty when nothing of the caller's is involved.
|
|
62
|
+
*/
|
|
63
|
+
kept: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface Rule {
|
|
66
|
+
name: string;
|
|
67
|
+
/** Returns a description of the breakage, or null when the identity holds. */
|
|
68
|
+
check: (config: Config, targetOs: string) => string | null;
|
|
69
|
+
/** Repairs the identity in place. null where no correct value is determined. */
|
|
70
|
+
repair: ((config: Config, targetOs: string) => void) | null;
|
|
71
|
+
/**
|
|
72
|
+
* Keys the repair only adjusts to stay consistent with what it repairs. A
|
|
73
|
+
* caller who set any of them keeps all of them as they were, the repair
|
|
74
|
+
* itself still runs, and they never block it.
|
|
75
|
+
*/
|
|
76
|
+
adjusts?: readonly string[];
|
|
77
|
+
}
|
|
78
|
+
/** The CPU architectures an identity can claim (Sec-CH-UA-Arch). */
|
|
79
|
+
export declare const CPU_ARCHES: readonly ["x86", "arm"];
|
|
80
|
+
/** The CPUs each OS runs on, by architecture: who makes them. */
|
|
81
|
+
export declare const CPU_MANUFACTURERS: Readonly<Record<OsKey, Readonly<Record<string, readonly string[]>>>>;
|
|
82
|
+
/** Logical core counts only Intel's hybrid parts report. */
|
|
83
|
+
export declare const INTEL_ONLY_CORE_COUNTS: ReadonlySet<number>;
|
|
84
|
+
/**
|
|
85
|
+
* The CPU architecture a machine with this GPU has, and its possible makers.
|
|
86
|
+
*
|
|
87
|
+
* [null, []] for a software renderer, which runs on any CPU. No makers leaves
|
|
88
|
+
* the maker open within the architecture.
|
|
89
|
+
*/
|
|
90
|
+
export declare function gpuCpu(gpuRenderer: unknown, targetOs: string): [string | null, readonly string[]];
|
|
91
|
+
/**
|
|
92
|
+
* [arch, manufacturer] for a caller's `cpu` option on `targetOs`.
|
|
93
|
+
*
|
|
94
|
+
* Throws ValueError for anything no machine running `targetOs` is: an unknown
|
|
95
|
+
* key, architecture or maker, or a pair such as an AMD Mac. A maker alone
|
|
96
|
+
* implies its architecture.
|
|
97
|
+
*/
|
|
98
|
+
export declare function resolveCpu(cpu: unknown, targetOs: OsKey): [string, string | null];
|
|
99
|
+
/** Why a machine with this GPU and core count cannot have this CPU, or null. */
|
|
100
|
+
export declare function cpuMisfit(gpuRenderer: unknown, cores: unknown, targetOs: string, arch: string, maker: string | null): string | null;
|
|
101
|
+
/**
|
|
102
|
+
* Why no Mac with this GPU has these cores and this screen, or null.
|
|
103
|
+
*
|
|
104
|
+
* It checks drawn records, which are rejected, as well as finished identities.
|
|
105
|
+
* fpgen's records include browsers that randomise hardwareConcurrency.
|
|
106
|
+
*/
|
|
107
|
+
export declare function machineMisfit(gpuRenderer: unknown, targetOs: string, cores: unknown, width: unknown, height: unknown): string | null;
|
|
108
|
+
/** A devicePixelRatio no display mode of the OS offers. */
|
|
109
|
+
export declare function isZoomedRatio(dpr: unknown, targetOs: string): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Move the ratio to the nearest display step and rescale the CSS geometry by
|
|
112
|
+
* the zoom that was folded in, so the screen is still the display behind it:
|
|
113
|
+
* 1760x990 at 1.0909 is a 1920x1080 monitor at 1.
|
|
114
|
+
*/
|
|
115
|
+
/** `keep` names sizes that are not the record's (a caller's window) and stay
|
|
116
|
+
* as they are. */
|
|
117
|
+
export declare function repairDevicePixelRatio(config: Config, targetOs: string, keep?: readonly string[]): void;
|
|
118
|
+
export declare const RULES: readonly Rule[];
|
|
119
|
+
/**
|
|
120
|
+
* The rules whose violation is refused at launch rather than warned about: a
|
|
121
|
+
* page, or the server before any page runs, reads each of them directly.
|
|
122
|
+
*/
|
|
123
|
+
export declare const FATAL_RULES: ReadonlySet<string>;
|
|
124
|
+
/** Whether the screen is one no desktop reports (portrait, or tiny). */
|
|
125
|
+
export declare function screenIsImplausible(config: Config): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Turn a portrait screen landscape, keeping the panel's own dimensions.
|
|
128
|
+
*
|
|
129
|
+
* A recorded 1440x2560 screen is a phone panel, or a desktop one captured
|
|
130
|
+
* while rotated. Either way a desktop identity that claims it is answering a
|
|
131
|
+
* `matchMedia('(orientation: portrait)')` the way no desktop does, so the axes
|
|
132
|
+
* are swapped rather than the numbers invented. Run before the window clamps,
|
|
133
|
+
* which then bound the window to the new screen.
|
|
134
|
+
*/
|
|
135
|
+
export declare function repairScreenOrientation(config: Config): boolean;
|
|
136
|
+
/** Every invariant this identity breaks. Empty means coherent. */
|
|
137
|
+
export declare function validate(config: Config, targetOs: string): Violation[];
|
|
138
|
+
/**
|
|
139
|
+
* Repair what is determined, and report what is left.
|
|
140
|
+
*
|
|
141
|
+
* A rule with no repair -- a Windows GPU on a macOS identity, a portrait
|
|
142
|
+
* screen -- cannot be corrected without inventing a machine, so it is returned
|
|
143
|
+
* for the caller to decide about. The caller that draws the identity can
|
|
144
|
+
* simply draw again.
|
|
145
|
+
*
|
|
146
|
+
* `keep` names the keys the caller set. A repair that would change one of
|
|
147
|
+
* them is not made: the caller's value stands, and the violation comes back
|
|
148
|
+
* with those keys in `kept` so the launcher can warn about it. A repair that
|
|
149
|
+
* only touches other keys still runs.
|
|
150
|
+
*/
|
|
151
|
+
export declare function apply(config: Config, targetOs: string, keep?: ReadonlySet<string>): Violation[];
|
|
152
|
+
export {};
|