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,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript twin of python/camoucore/src/camoucore/camoufox/exceptions.py. The errors the core
|
|
3
|
+
* raises are camoucore's, re-exported so `catch` sites keep one import.
|
|
4
|
+
*
|
|
5
|
+
* The Python hierarchy leans on builtin bases (FileNotFoundError, ValueError,
|
|
6
|
+
* ImportError) that have no JS analogue; those become plain Error subclasses
|
|
7
|
+
* here. Every relationship that callers actually catch on -- LocaleError,
|
|
8
|
+
* VirtualDisplayError -- is preserved.
|
|
9
|
+
*/
|
|
10
|
+
import { VirtualDisplayError } from "../exceptions.js";
|
|
11
|
+
export { CannotExecuteXvfb, CannotFindXvfb, CorruptedDownload, InvalidIP, InvalidLocale, InvalidProxy, LocaleError, NotInstalledGeoIPExtra, UnknownIPLocation, UnknownLanguage, UnknownTerritory, UnsupportedOS, VirtualDisplayError, VirtualDisplayNotSupported, } from "../exceptions.js";
|
|
12
|
+
/** The Python twin relies on the builtin FileNotFoundError; JS has no such
|
|
13
|
+
* class, so version-lookup misses raise this instead. */
|
|
14
|
+
export declare class FileNotFoundError extends Error {
|
|
15
|
+
constructor(message?: string);
|
|
16
|
+
}
|
|
17
|
+
export declare class UnsupportedVersion extends Error {
|
|
18
|
+
constructor(message?: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class MissingRelease extends Error {
|
|
21
|
+
constructor(message?: string);
|
|
22
|
+
}
|
|
23
|
+
export declare class UnsupportedArchitecture extends Error {
|
|
24
|
+
constructor(message?: string);
|
|
25
|
+
}
|
|
26
|
+
export declare class InvalidPropertyType extends Error {
|
|
27
|
+
constructor(message?: string);
|
|
28
|
+
}
|
|
29
|
+
export declare class InvalidAddonPath extends FileNotFoundError {
|
|
30
|
+
constructor(message?: string);
|
|
31
|
+
}
|
|
32
|
+
export declare class NonFirefoxFingerprint extends Error {
|
|
33
|
+
constructor(message?: string);
|
|
34
|
+
}
|
|
35
|
+
export declare class InvalidOS extends Error {
|
|
36
|
+
constructor(message?: string);
|
|
37
|
+
}
|
|
38
|
+
export declare class GpuDisplayError extends VirtualDisplayError {
|
|
39
|
+
constructor(message?: string);
|
|
40
|
+
}
|
|
41
|
+
export declare class NoGpuFound extends GpuDisplayError {
|
|
42
|
+
constructor(message?: string);
|
|
43
|
+
}
|
|
44
|
+
export declare class AmbiguousGpuSelection extends GpuDisplayError {
|
|
45
|
+
constructor(message?: string);
|
|
46
|
+
}
|
|
47
|
+
export declare class GpuNotFound extends GpuDisplayError {
|
|
48
|
+
constructor(message?: string);
|
|
49
|
+
}
|
|
50
|
+
export declare class CannotFindXorg extends GpuDisplayError {
|
|
51
|
+
constructor(message?: string);
|
|
52
|
+
}
|
|
53
|
+
export declare class CannotExecuteXorg extends GpuDisplayError {
|
|
54
|
+
constructor(message?: string);
|
|
55
|
+
}
|
|
56
|
+
export declare class GpuVtTakeover extends GpuDisplayError {
|
|
57
|
+
constructor(message?: string);
|
|
58
|
+
}
|
|
59
|
+
export declare class GpuSoftwareFallback extends GpuDisplayError {
|
|
60
|
+
constructor(message?: string);
|
|
61
|
+
}
|
|
62
|
+
export declare class CamoufoxNotInstalled extends FileNotFoundError {
|
|
63
|
+
constructor(message?: string);
|
|
64
|
+
}
|
|
65
|
+
/** Raised when Camoufox's required runtime directory cannot be prepared. */
|
|
66
|
+
export declare class ProfileDirectoryError extends Error {
|
|
67
|
+
constructor(message?: string, options?: ErrorOptions);
|
|
68
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript twin of python/camoucore/src/camoucore/camoufox/exceptions.py. The errors the core
|
|
3
|
+
* raises are camoucore's, re-exported so `catch` sites keep one import.
|
|
4
|
+
*
|
|
5
|
+
* The Python hierarchy leans on builtin bases (FileNotFoundError, ValueError,
|
|
6
|
+
* ImportError) that have no JS analogue; those become plain Error subclasses
|
|
7
|
+
* here. Every relationship that callers actually catch on -- LocaleError,
|
|
8
|
+
* VirtualDisplayError -- is preserved.
|
|
9
|
+
*/
|
|
10
|
+
import { VirtualDisplayError } from "../exceptions.js";
|
|
11
|
+
export { CannotExecuteXvfb, CannotFindXvfb, CorruptedDownload, InvalidIP, InvalidLocale, InvalidProxy, LocaleError, NotInstalledGeoIPExtra, UnknownIPLocation, UnknownLanguage, UnknownTerritory, UnsupportedOS, VirtualDisplayError, VirtualDisplayNotSupported, } from "../exceptions.js";
|
|
12
|
+
/** The Python twin relies on the builtin FileNotFoundError; JS has no such
|
|
13
|
+
* class, so version-lookup misses raise this instead. */
|
|
14
|
+
export class FileNotFoundError extends Error {
|
|
15
|
+
constructor(message) {
|
|
16
|
+
super(message ?? "File couldn't be found.");
|
|
17
|
+
this.name = "FileNotFoundError";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class UnsupportedVersion extends Error {
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(message ?? "The Camoufox executable is outdated.");
|
|
23
|
+
this.name = "UnsupportedVersion";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export class MissingRelease extends Error {
|
|
27
|
+
constructor(message) {
|
|
28
|
+
super(message ?? "A required GitHub release asset is missing.");
|
|
29
|
+
this.name = "MissingRelease";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class UnsupportedArchitecture extends Error {
|
|
33
|
+
constructor(message) {
|
|
34
|
+
super(message ?? "The architecture is not supported.");
|
|
35
|
+
this.name = "UnsupportedArchitecture";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export class InvalidPropertyType extends Error {
|
|
39
|
+
constructor(message) {
|
|
40
|
+
super(message ?? "The property type is invalid.");
|
|
41
|
+
this.name = "InvalidPropertyType";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export class InvalidAddonPath extends FileNotFoundError {
|
|
45
|
+
constructor(message) {
|
|
46
|
+
super(message ?? "The addon path is invalid.");
|
|
47
|
+
this.name = "InvalidAddonPath";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export class NonFirefoxFingerprint extends Error {
|
|
51
|
+
constructor(message) {
|
|
52
|
+
super(message ?? "A passed fingerprint is not a Firefox fingerprint.");
|
|
53
|
+
this.name = "NonFirefoxFingerprint";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export class InvalidOS extends Error {
|
|
57
|
+
constructor(message) {
|
|
58
|
+
super(message ?? "The target OS is invalid.");
|
|
59
|
+
this.name = "InvalidOS";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export class GpuDisplayError extends VirtualDisplayError {
|
|
63
|
+
constructor(message) {
|
|
64
|
+
super(message ?? "The headless='virtual-gpu' display cannot be used.");
|
|
65
|
+
this.name = "GpuDisplayError";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export class NoGpuFound extends GpuDisplayError {
|
|
69
|
+
constructor(message) {
|
|
70
|
+
super(message ?? "No GPU render node with a PCI address was found.");
|
|
71
|
+
this.name = "NoGpuFound";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export class AmbiguousGpuSelection extends GpuDisplayError {
|
|
75
|
+
constructor(message) {
|
|
76
|
+
super(message ?? "Several GPUs match, or several exist and none was named.");
|
|
77
|
+
this.name = "AmbiguousGpuSelection";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class GpuNotFound extends GpuDisplayError {
|
|
81
|
+
constructor(message) {
|
|
82
|
+
super(message ?? "The GPU selector matches no GPU.");
|
|
83
|
+
this.name = "GpuNotFound";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export class CannotFindXorg extends GpuDisplayError {
|
|
87
|
+
constructor(message) {
|
|
88
|
+
super(message ?? "Xorg cannot be found.");
|
|
89
|
+
this.name = "CannotFindXorg";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export class CannotExecuteXorg extends GpuDisplayError {
|
|
93
|
+
constructor(message) {
|
|
94
|
+
super(message ?? "Xorg cannot be started, or exited right after starting.");
|
|
95
|
+
this.name = "CannotExecuteXorg";
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export class GpuVtTakeover extends GpuDisplayError {
|
|
99
|
+
constructor(message) {
|
|
100
|
+
super(message ?? "The Xorg server switched the active console VT.");
|
|
101
|
+
this.name = "GpuVtTakeover";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export class GpuSoftwareFallback extends GpuDisplayError {
|
|
105
|
+
constructor(message) {
|
|
106
|
+
super(message ?? "The browser on a GPU display never rendered on the GPU.");
|
|
107
|
+
this.name = "GpuSoftwareFallback";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export class CamoufoxNotInstalled extends FileNotFoundError {
|
|
111
|
+
constructor(message) {
|
|
112
|
+
super(message ?? "Camoufox is not installed.");
|
|
113
|
+
this.name = "CamoufoxNotInstalled";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Raised when Camoufox's required runtime directory cannot be prepared. */
|
|
117
|
+
export class ProfileDirectoryError extends Error {
|
|
118
|
+
constructor(message, options) {
|
|
119
|
+
super(message ?? "Camoufox's runtime directory could not be prepared.", options);
|
|
120
|
+
this.name = "ProfileDirectoryError";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
export type { TargetOS } from "./webgl.js";
|
|
2
|
+
type Config = Record<string, any>;
|
|
3
|
+
export declare const SUPPORTED_OS: readonly ["linux", "macos", "windows"];
|
|
4
|
+
export type SupportedOS = (typeof SUPPORTED_OS)[number];
|
|
5
|
+
/** The fpgen -> Camoufox config mapping. */
|
|
6
|
+
export declare const FPGEN_DATA: Readonly<Record<string, Record<string, string>>>;
|
|
7
|
+
export declare const FPGEN_OS: Readonly<Record<string, string>>;
|
|
8
|
+
export interface ScreenBounds {
|
|
9
|
+
minWidth?: number | null;
|
|
10
|
+
maxWidth?: number | null;
|
|
11
|
+
minHeight?: number | null;
|
|
12
|
+
maxHeight?: number | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A bound on the screen a generated fingerprint may claim (the twin of the
|
|
16
|
+
* Python dataclass that replaced browserforge's Screen).
|
|
17
|
+
*/
|
|
18
|
+
export declare class Screen {
|
|
19
|
+
minWidth: number | null;
|
|
20
|
+
maxWidth: number | null;
|
|
21
|
+
minHeight: number | null;
|
|
22
|
+
maxHeight: number | null;
|
|
23
|
+
constructor({ minWidth, maxWidth, minHeight, maxHeight, }?: ScreenBounds);
|
|
24
|
+
/**
|
|
25
|
+
* The bound as fpgen conditions: one predicate over the whole screen node.
|
|
26
|
+
* fpgen resolves screen.width and screen.height to that same node and each
|
|
27
|
+
* condition resets its evidence (build_evidence), so with one per field
|
|
28
|
+
* only the height bound held and 1280x1024 met a 1300 px minimum width.
|
|
29
|
+
*/
|
|
30
|
+
asConditions(): Record<string, (value: unknown) => boolean>;
|
|
31
|
+
/** dataclasses.asdict(), with the Python field names (for identitySalt). */
|
|
32
|
+
toPyDict(): Record<string, number | null>;
|
|
33
|
+
}
|
|
34
|
+
export interface Preset {
|
|
35
|
+
navigator?: Record<string, any>;
|
|
36
|
+
screen?: Record<string, any>;
|
|
37
|
+
webgl?: Record<string, any>;
|
|
38
|
+
timezone?: string;
|
|
39
|
+
fonts?: string[];
|
|
40
|
+
speechVoices?: Array<string | VoiceObject>;
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
43
|
+
export interface PresetBundle {
|
|
44
|
+
presets?: Partial<Record<SupportedOS, Preset[]>>;
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}
|
|
47
|
+
export declare const PRESETS_FILE: string;
|
|
48
|
+
export declare const PRESETS_V150_FILE: string;
|
|
49
|
+
/** Firefox major version at which the v150 preset bundle becomes preferred. */
|
|
50
|
+
export declare const PRESETS_V150_MIN_FF = 149;
|
|
51
|
+
export declare const MACOS_MARKER_FONTS: readonly string[];
|
|
52
|
+
export declare const LINUX_MARKER_FONTS: readonly string[];
|
|
53
|
+
export declare const WINDOWS_MARKER_FONTS: readonly string[];
|
|
54
|
+
/** The full OS font lists (fonts.json). */
|
|
55
|
+
export declare function loadOsFonts(): Record<string, string[]>;
|
|
56
|
+
export declare const ESSENTIAL_FONTS_MACOS: readonly string[];
|
|
57
|
+
export declare const ESSENTIAL_FONTS_WINDOWS: readonly string[];
|
|
58
|
+
export declare const ESSENTIAL_FONTS_LINUX: readonly string[];
|
|
59
|
+
/**
|
|
60
|
+
* Fonts only a Windows 11 base has: a Windows identity whose font list
|
|
61
|
+
* contains them presents Windows 11, and the rest of the identity must agree.
|
|
62
|
+
*/
|
|
63
|
+
export declare const WINDOWS_11_MARKER_FONTS: ReadonlySet<string>;
|
|
64
|
+
/**
|
|
65
|
+
* The entropy that makes identitySeed() belong to ONE identity.
|
|
66
|
+
*
|
|
67
|
+
* Pass whatever the caller pinned the identity with -- an fpgen fingerprint,
|
|
68
|
+
* a preset, the caller's own config -- for a salt that is stable across
|
|
69
|
+
* launches of that identity; pass nothing for a fresh, random one. The salt
|
|
70
|
+
* is the first 8 bytes (big-endian) of the SHA-256 of the orjson
|
|
71
|
+
* serialization with sorted keys, exactly as Python computes it, so a pinned
|
|
72
|
+
* identity draws the same fonts, voices, GPU and noise seeds in both
|
|
73
|
+
* launchers. (Integral floats and integers above 2**53 only hash like
|
|
74
|
+
* Python's when they arrive as PyFloat / bigint -- see pycompat.parsePyJson.)
|
|
75
|
+
*/
|
|
76
|
+
export declare function identitySalt(pinned?: unknown): bigint;
|
|
77
|
+
/**
|
|
78
|
+
* The UA with the browser's version taken out, for identitySeed(). A saved
|
|
79
|
+
* identity on a newer browser claims the new engine version and nothing else
|
|
80
|
+
* changes, so the seed must not move with it (Python: versionless_ua).
|
|
81
|
+
*/
|
|
82
|
+
export declare function versionlessUa(userAgent: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* A seed for the per-identity draws: a pure function of the presented
|
|
85
|
+
* identity (UA without its version, platform, screen, cores) and its salt --
|
|
86
|
+
* zlib.crc32 of the values' Python str() joined by "|".
|
|
87
|
+
*/
|
|
88
|
+
export declare function identitySeed(config: Config, salt?: number | bigint): number;
|
|
89
|
+
/**
|
|
90
|
+
* audio:seed is gone: the browser renders audio as stock Firefox does. A
|
|
91
|
+
* caller's seed is dropped with a warning rather than sent to a browser that
|
|
92
|
+
* would noise with it (a released one) or ignore it (this one).
|
|
93
|
+
*/
|
|
94
|
+
export declare function dropAudioSeed(config: Record<string, unknown>): void;
|
|
95
|
+
/** The families of one addition unit (font-groups.json), e.g. ("win", "office"). */
|
|
96
|
+
export declare function fontUnitFamilies(osKey: string, unitId: string): Set<string>;
|
|
97
|
+
/**
|
|
98
|
+
* The font list of one plausible machine of the given OS
|
|
99
|
+
* (`_generate_random_font_subset`): one OS-version base by weight, never
|
|
100
|
+
* subsetted, then each addition unit at its own measured probability, then
|
|
101
|
+
* the marker fonts.
|
|
102
|
+
*
|
|
103
|
+
* @param locale gates the units the manifest marks `requiresLocale`.
|
|
104
|
+
* @param native the identity is the host's own OS (macOS / Windows), where the
|
|
105
|
+
* real system fonts are used: only the OS base is claimed.
|
|
106
|
+
*/
|
|
107
|
+
export declare function generateRandomFontSubset(targetOs: string, seed?: number | bigint | null, native?: boolean, locale?: string | null): string[];
|
|
108
|
+
export interface VoiceObject {
|
|
109
|
+
name: string;
|
|
110
|
+
lang: string;
|
|
111
|
+
voiceUri: string;
|
|
112
|
+
isDefault: boolean;
|
|
113
|
+
isLocalService: boolean;
|
|
114
|
+
}
|
|
115
|
+
export declare const MAC_NOVELTY_VOICES: ReadonlySet<string>;
|
|
116
|
+
export declare const MAC_ELOQUENCE_VOICES: ReadonlySet<string>;
|
|
117
|
+
/** A voiceUri matching what real Firefox emits for the OS backend. */
|
|
118
|
+
export declare function voiceUri(osKey: string, name: string, lang: string): string;
|
|
119
|
+
/** A Linux identity's speech-dispatcher voices (`voices:speechd`). */
|
|
120
|
+
export interface SpeechdGrid {
|
|
121
|
+
languages: Array<[string, string]>;
|
|
122
|
+
variants: string[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* (name, lang) per voice in speech-dispatcher's order (`_speechd_voices`):
|
|
126
|
+
* each language alone, then with every variant.
|
|
127
|
+
*/
|
|
128
|
+
export declare function speechdVoices(grid: SpeechdGrid): Array<[string, string]>;
|
|
129
|
+
/**
|
|
130
|
+
* The identity's voices as the config keys the browser reads
|
|
131
|
+
* (`draw_voice_config`): `voices` on macOS and Windows, `voices:speechd` on
|
|
132
|
+
* Linux, whose ~15000 voices only fit in the environment as their grid.
|
|
133
|
+
*/
|
|
134
|
+
export declare function drawVoiceConfig(targetOs: string, locale?: string | null, seed?: number | bigint | null): Record<string, any>;
|
|
135
|
+
/**
|
|
136
|
+
* The speech voice list for the given OS as MaskConfig voice objects
|
|
137
|
+
* (`_generate_random_voice_subset`), following the measured per-OS model in
|
|
138
|
+
* voice-manifests.json. Seeded by the identity so it always reports the same
|
|
139
|
+
* list. macOS marks its system voice default; Windows and Linux mark none.
|
|
140
|
+
*/
|
|
141
|
+
export declare function generateRandomVoiceSubset(targetOs: string, locale?: string | null, seed?: number | bigint | null): VoiceObject[];
|
|
142
|
+
/**
|
|
143
|
+
* Coerce a preset's `speechVoices` into MaskConfig voice objects: presets
|
|
144
|
+
* store "Name:lang:type" strings, which MaskConfig drops. Objects pass through.
|
|
145
|
+
*/
|
|
146
|
+
export declare function normalizePresetVoices(voices: Array<string | VoiceObject>, targetOs: string): VoiceObject[];
|
|
147
|
+
/**
|
|
148
|
+
* Logical CPUs this process may run on (affinity aware), as they were before
|
|
149
|
+
* any launch pinned it: see cpu_affinity.hostCoreCount().
|
|
150
|
+
*/
|
|
151
|
+
export declare function hostCpuCount(): number | null;
|
|
152
|
+
/**
|
|
153
|
+
* Core counts real desktop machines ship with, from the recorded fingerprint
|
|
154
|
+
* corpus. 2 is excluded: no Apple Silicon part has 2 cores, and 85% of macOS
|
|
155
|
+
* identities draw an Apple GPU (see fingerprints.py).
|
|
156
|
+
*/
|
|
157
|
+
export declare const PLAUSIBLE_CORE_COUNTS: readonly number[];
|
|
158
|
+
export interface HostCpu {
|
|
159
|
+
/** Logical CPUs of the host (default: hostCpuCount()). */
|
|
160
|
+
cpuCount?: number | null;
|
|
161
|
+
/** Whether the host can pin processes to cores (default: cpu_affinity.supported()). */
|
|
162
|
+
canPinHost?: boolean;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* navigator.hardwareConcurrency = the host's parallelism, snapped DOWN into
|
|
166
|
+
* PLAUSIBLE_CORE_COUNTS -- or the fingerprint's own value (snapped, capped by
|
|
167
|
+
* the host) when the browser can be pinned to that many cores.
|
|
168
|
+
*
|
|
169
|
+
* On an Intel Mac the count yields to the GPU: the GPU is read before this
|
|
170
|
+
* runs, and a count no Mac with it reports would drop it (#1090). Apple
|
|
171
|
+
* Silicon is snapped to its GPU by the apple-silicon-cores repair.
|
|
172
|
+
*
|
|
173
|
+
* @param canPin false when nothing will pin the browser (launchServer, or
|
|
174
|
+
* launchOptions used directly); undefined/null: whatever the host supports.
|
|
175
|
+
* @param host overrides for the host probes (tests).
|
|
176
|
+
* @param targetOs the launch's OS key; the GPU bound applies to "mac" only.
|
|
177
|
+
*/
|
|
178
|
+
export declare function fixHardwareConcurrency(config: Config, canPin?: boolean | null, host?: HostCpu, targetOs?: string | null): void;
|
|
179
|
+
/** Force navigator.platform AND navigator.oscpu to match the UA's arch (Linux). */
|
|
180
|
+
export declare function fixNavigatorArch(config: Config, targetOs: string): void;
|
|
181
|
+
export declare const BASELINE_TASKBAR_HEIGHT: Record<string, number>;
|
|
182
|
+
export declare const BASELINE_MULTI_TOUCH_POINTS: number;
|
|
183
|
+
export declare const RECORDED_WINDOW_CHROME: Record<string, [number, number]>;
|
|
184
|
+
/** A page's size, or a window's position and outer size. */
|
|
185
|
+
export interface Box {
|
|
186
|
+
x?: number | null;
|
|
187
|
+
y?: number | null;
|
|
188
|
+
width: number;
|
|
189
|
+
height: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The smallest screen, [width, height], that holds a page's window.
|
|
193
|
+
*
|
|
194
|
+
* A page with `viewport` sits in a window the recorded chrome larger; the page
|
|
195
|
+
* also reports `window` (its position and outer size), which has to be on the
|
|
196
|
+
* screen too. The height adds the taskbar the browser takes out of the
|
|
197
|
+
* available screen for the claimed OS (BASELINE_TASKBAR_HEIGHT), so the window
|
|
198
|
+
* fits screen.availHeight.
|
|
199
|
+
*/
|
|
200
|
+
export declare function screenFloor(osKey: string, viewport?: Box | null, window?: Box | null): [number, number];
|
|
201
|
+
/**
|
|
202
|
+
* A recorded screen of the OS at least `floor` in size, or null if the model
|
|
203
|
+
* has none that large.
|
|
204
|
+
*/
|
|
205
|
+
export declare function drawScreen(osKey: string, floor: [number, number]): [number, number] | null;
|
|
206
|
+
/**
|
|
207
|
+
* Claim the available screen and touch points the browser will report.
|
|
208
|
+
* clampWindowDimensions then fits the window inside that screen.
|
|
209
|
+
*/
|
|
210
|
+
export declare function followBaselineProtection(config: Config, targetOs: string): void;
|
|
211
|
+
/** Enforce inner <= outer <= avail <= screen on both axes. */
|
|
212
|
+
export declare function clampWindowDimensions(config: Config): void;
|
|
213
|
+
/**
|
|
214
|
+
* Shrink screen.width/height down to the bounds of the real display, keeping
|
|
215
|
+
* the taskbar delta. Run clampWindowDimensions afterwards.
|
|
216
|
+
*/
|
|
217
|
+
export declare function clampScreenToDisplay(config: Config, maxWidth: number | null | undefined, maxHeight: number | null | undefined): void;
|
|
218
|
+
/**
|
|
219
|
+
* Keep the window box inside the available screen: 0 <= screenX/Y <= avail -
|
|
220
|
+
* outer. The available screen, not the whole one: pages are fitted to the
|
|
221
|
+
* window on screen.availHeight (screenFloor), and a window at y=2 whose outer
|
|
222
|
+
* height is the available height ran 2 px into the taskbar, so every new
|
|
223
|
+
* context drew a larger screen for it. Only `keys` are moved.
|
|
224
|
+
*/
|
|
225
|
+
export declare function clampWindowPosition(config: Config, keys?: ReadonlySet<string>): void;
|
|
226
|
+
/** The smallest screen mainstream hardware still ships. */
|
|
227
|
+
export declare const MODERN_SCREEN_FLOOR: readonly [number, number];
|
|
228
|
+
/**
|
|
229
|
+
* Lift netbook-era screen geometry to the modern floor, keeping the
|
|
230
|
+
* screen-to-avail gaps. Call BEFORE clampScreenToDisplay.
|
|
231
|
+
*/
|
|
232
|
+
export declare function raiseScreenToModernFloor(config: Config): void;
|
|
233
|
+
/**
|
|
234
|
+
* Draw one machine's media devices for `osKey` ('win'|'mac'|'lin'): the
|
|
235
|
+
* mediaDevices:* config keys, counts plus aligned label and group lists.
|
|
236
|
+
*/
|
|
237
|
+
export declare function drawMediaDevices(osKey: string, seed: number | bigint | null | undefined): Config;
|
|
238
|
+
/**
|
|
239
|
+
* Give the identity a plausible set of media devices, drawn from the common
|
|
240
|
+
* desktop population for its OS and seeded by the identity. Nothing is drawn
|
|
241
|
+
* when the caller already set any mediaDevices: key.
|
|
242
|
+
*/
|
|
243
|
+
export declare function setMediaDevicesDefaults(config: Config, salt?: number | bigint): void;
|
|
244
|
+
/**
|
|
245
|
+
* Share of machines whose one adapter carries IPv6 next to IPv4. No recorded
|
|
246
|
+
* corpus has the ICE shape; this is Google's IPv6 adoption figure (~45% of its
|
|
247
|
+
* users in 2025, google.com/ipv6/statistics), which counts global IPv6 only,
|
|
248
|
+
* so it is a lower bound. A real-device measurement replaces it.
|
|
249
|
+
*/
|
|
250
|
+
export declare const HOST_IPV6_SHARE = 0.45;
|
|
251
|
+
/**
|
|
252
|
+
* Draw the identity's network shape: one adapter, IPv4 only or IPv4 + IPv6
|
|
253
|
+
* (webrtc:hostipv6, webrtc-topology-host-ipv6.patch). Mirrors Python's
|
|
254
|
+
* set_host_ipv6_default; nothing is drawn when the caller set it.
|
|
255
|
+
*/
|
|
256
|
+
export declare function setHostIpv6Default(config: Config, salt?: number | bigint): void;
|
|
257
|
+
/**
|
|
258
|
+
* Windows' location setting for desktop apps, as Firefox reads it
|
|
259
|
+
* (GeolocationSystemWin.cpp). No recorded corpus has it; an estimate a
|
|
260
|
+
* real-device measurement replaces. Mirrors Python's
|
|
261
|
+
* WINDOWS_LOCATION_SETTING_SHARES.
|
|
262
|
+
*/
|
|
263
|
+
export declare const WINDOWS_LOCATION_SETTING_SHARES: ReadonlyArray<[string, number]>;
|
|
264
|
+
/**
|
|
265
|
+
* Draw the identity's OS location setting (geolocation:systemPermission,
|
|
266
|
+
* geolocation-spoofing.patch) for a Windows identity on another host. Mirrors
|
|
267
|
+
* Python's set_location_setting_default.
|
|
268
|
+
*/
|
|
269
|
+
export declare function setLocationSettingDefault(config: Config, salt: number | bigint, targetOs: string, hostOs: string | null): void;
|
|
270
|
+
/**
|
|
271
|
+
* When stock Windows Firefox's deferred font-info loader lands the legacy
|
|
272
|
+
* styled-family aliases after the first legacy lookup (stock 158.0.1 on win-i9:
|
|
273
|
+
* 1727, 1826, 1832 ms on a 100 ms poll). Mirrors Python's
|
|
274
|
+
* WINDOWS_ALIAS_LOAD_MS / set_windows_alias_load_default: drawn per launch for a
|
|
275
|
+
* Windows identity on another OS; a caller's value is kept.
|
|
276
|
+
*/
|
|
277
|
+
export declare const WINDOWS_ALIAS_LOAD_MS: readonly [number, number];
|
|
278
|
+
/**
|
|
279
|
+
* How long stock Windows Firefox's character-map pass takes to land after the
|
|
280
|
+
* first fallback within a family whose cmaps are not loaded yet
|
|
281
|
+
* (windows-lazy-cmaps.patch; win-i9: 80, 154, 182 ms). Mirrors Python's
|
|
282
|
+
* WINDOWS_CMAP_LOAD_MS; drawn with the alias load time.
|
|
283
|
+
*/
|
|
284
|
+
export declare const WINDOWS_CMAP_LOAD_MS: readonly [number, number];
|
|
285
|
+
/**
|
|
286
|
+
* Injection point for the draws that belong to the launch, not the identity
|
|
287
|
+
* (timing: a real machine's figure moves from launch to launch). Mirrors
|
|
288
|
+
* Python's launch_uniform(); the launch goldens pin both to one value.
|
|
289
|
+
*/
|
|
290
|
+
export declare const fingerprintDeps: {
|
|
291
|
+
random: () => number;
|
|
292
|
+
};
|
|
293
|
+
export declare function setWindowsAliasLoadDefault(config: Config, targetOs: string, hostOs: string | null): void;
|
|
294
|
+
/**
|
|
295
|
+
* Draw the identity's audio output device latency (AudioContext:outputLatency,
|
|
296
|
+
* audio-context-spoofing.patch). The device latency follows the identity seed;
|
|
297
|
+
* the stream's opening delay is drawn per launch. Mirrors Python's
|
|
298
|
+
* set_output_latency_default; nothing is set when the caller set the key, the
|
|
299
|
+
* identity claims the host's OS, or the OS has no measured devices.
|
|
300
|
+
*/
|
|
301
|
+
export declare function setOutputLatencyDefault(config: Config, salt: number | bigint, targetOs: string, hostOs: string | null): void;
|
|
302
|
+
/**
|
|
303
|
+
* Intel's share of the x86 desktop CPUs running Firefox (Firefox Public Data
|
|
304
|
+
* Report, week of 2026-11-02: Intel 76.86%, AMD 17.61%); fingerprints.py.
|
|
305
|
+
*/
|
|
306
|
+
export declare const X86_INTEL_SHARE: number;
|
|
307
|
+
/**
|
|
308
|
+
* Fill in the identity's CPU (cpu:arch, cpu:manufacturer), as
|
|
309
|
+
* fingerprints.set_cpu_default does. The GPU decides what it can (an Apple
|
|
310
|
+
* GPU is an Apple ARM CPU, an Intel iGPU or Intel Mac an Intel one, a Radeon
|
|
311
|
+
* iGPU an AMD one), then a core count only Intel ships; any other x86
|
|
312
|
+
* identity's vendor is drawn at Firefox's own x86 split, seeded by the
|
|
313
|
+
* identity. An ARM identity whose GPU names no single SoC maker keeps its
|
|
314
|
+
* manufacturer unset: every ARM64 CPU computes alike. Run after the GPU and
|
|
315
|
+
* navigator.hardwareConcurrency are final. Keys the caller set are kept.
|
|
316
|
+
*/
|
|
317
|
+
export declare function setCpuDefault(config: Config, targetOs: string, salt?: number | bigint): void;
|
|
318
|
+
/** Reduce a reported renderer to Gecko's sanitized device bucket. */
|
|
319
|
+
export declare function rendererBucket(renderer: string): string;
|
|
320
|
+
/** Whether `renderer` is a software rasterizer rather than real hardware. */
|
|
321
|
+
export declare function isSoftwareRenderer(renderer: string | null | undefined): boolean;
|
|
322
|
+
/** Whether `renderer` is a GPU that plausibly drives a `width` x `height` screen. */
|
|
323
|
+
export declare function gpuScreenIsPlausible(renderer: string | null | undefined, width: number | null | undefined, height: number | null | undefined): boolean;
|
|
324
|
+
/** The bundled-presets file for a Firefox version (v150 bundle from 149 up). */
|
|
325
|
+
export declare function selectPresetsFile(ffVersion?: string | number | null): string;
|
|
326
|
+
/** Load the bundled fingerprint presets. */
|
|
327
|
+
export declare function loadPresets(ffVersion?: string | number | null): PresetBundle | null;
|
|
328
|
+
/**
|
|
329
|
+
* A random preset for the given OS (or OSes), or null when none is bundled.
|
|
330
|
+
* Draws from python-random's module-level `choice` (Python's random.choice).
|
|
331
|
+
*/
|
|
332
|
+
export declare function getRandomPreset(os?: string | readonly string[] | null, ffVersion?: string | number | null): Preset | null;
|
|
333
|
+
/**
|
|
334
|
+
* The appVersion Firefox reports for a browser sending this user agent:
|
|
335
|
+
* "5.0 (<OS tokens>)" without the architecture, the Gecko revision, or the
|
|
336
|
+
* Windows build number.
|
|
337
|
+
*/
|
|
338
|
+
export declare function appVersionFromUserAgent(userAgent: string | null | undefined): string | null;
|
|
339
|
+
/**
|
|
340
|
+
* Convert a real fingerprint preset to CAMOU_CONFIG format.
|
|
341
|
+
*
|
|
342
|
+
* `salt` (identitySalt) keys the font/voice draws; undefined draws a fresh
|
|
343
|
+
* one, so two users of the same recorded device do not share its font list.
|
|
344
|
+
*/
|
|
345
|
+
export declare function fromPreset(preset: Preset, ffVersion?: string | number | null, salt?: number | bigint | null): Config;
|
|
346
|
+
export interface InitValues {
|
|
347
|
+
navigatorPlatform?: string;
|
|
348
|
+
navigatorOscpu?: string;
|
|
349
|
+
navigatorUserAgent?: string;
|
|
350
|
+
navigatorAppVersion?: string;
|
|
351
|
+
hardwareConcurrency?: number;
|
|
352
|
+
webglVendor?: string;
|
|
353
|
+
webglRenderer?: string;
|
|
354
|
+
screenWidth?: number;
|
|
355
|
+
screenHeight?: number;
|
|
356
|
+
screenAvailWidth?: number;
|
|
357
|
+
screenAvailHeight?: number;
|
|
358
|
+
screenColorDepth?: number;
|
|
359
|
+
timezone?: string;
|
|
360
|
+
fontList?: string[];
|
|
361
|
+
speechVoices?: Array<string | VoiceObject> | {
|
|
362
|
+
speechd: SpeechdGrid;
|
|
363
|
+
};
|
|
364
|
+
webrtcIP?: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* The JavaScript init script that calls the per-context window.setXxx()
|
|
368
|
+
* functions. Those self-destruct after their first call, so they must run
|
|
369
|
+
* via addInitScript.
|
|
370
|
+
*/
|
|
371
|
+
export declare function buildInitScript(values: InitValues): string;
|
|
372
|
+
export interface ContextFingerprint {
|
|
373
|
+
init_script: string;
|
|
374
|
+
context_options: Record<string, any>;
|
|
375
|
+
config: Config;
|
|
376
|
+
preset: Preset;
|
|
377
|
+
}
|
|
378
|
+
/** The OS a navigator.platform value presents, as a Camoufox OS name. */
|
|
379
|
+
export declare function targetOsFromPlatform(plat: string): SupportedOS;
|
|
380
|
+
/**
|
|
381
|
+
* Fingerprint values for a single per-context identity: the init script plus
|
|
382
|
+
* the Playwright context options (camelCase, for playwright-core).
|
|
383
|
+
*
|
|
384
|
+
* By default an fpgen fingerprint is generated; pass a preset to use a real
|
|
385
|
+
* recorded one instead.
|
|
386
|
+
*
|
|
387
|
+
* @param timezone IANA timezone; takes priority over the preset's.
|
|
388
|
+
* @param locale BCP-47 locale; also sets context_options.locale.
|
|
389
|
+
* @param config_overrides CAMOU_CONFIG keys applied after the config is built
|
|
390
|
+
* and before the init script is rendered.
|
|
391
|
+
* @param webgl_config The [vendor, renderer] a drawn identity claims, instead
|
|
392
|
+
* of drawing one.
|
|
393
|
+
* @param screen_bound A bound on the drawn screen (screenFloor: one that holds
|
|
394
|
+
* the window the context's pages report). A preset keeps its own.
|
|
395
|
+
*/
|
|
396
|
+
export declare function generateContextFingerprint({ preset, os, ff_version, webrtc_ip, timezone, locale, config_overrides, webgl_config, screen_bound, }?: {
|
|
397
|
+
preset?: Preset | null;
|
|
398
|
+
os?: string | null;
|
|
399
|
+
ff_version?: string | null;
|
|
400
|
+
webrtc_ip?: string | null;
|
|
401
|
+
timezone?: string | null;
|
|
402
|
+
locale?: string | null;
|
|
403
|
+
config_overrides?: Config | null;
|
|
404
|
+
webgl_config?: [string, string] | null;
|
|
405
|
+
screen_bound?: Screen | null;
|
|
406
|
+
}): ContextFingerprint;
|
|
407
|
+
/** Converts an fpgen fingerprint to a Camoufox config. */
|
|
408
|
+
export declare function fromFpgen(fingerprint: Record<string, any>, ffVersion?: string | number | null): Config;
|
|
409
|
+
/**
|
|
410
|
+
* handleWindowSize() for a config: its geometry is final, where a drawn
|
|
411
|
+
* fingerprint's is still rescaled when its devicePixelRatio moves.
|
|
412
|
+
*/
|
|
413
|
+
export declare function placeWindow(config: Config, outerWidth: number, outerHeight: number): void;
|
|
414
|
+
/** Sets a custom outer window size and centers it in the screen (in place). */
|
|
415
|
+
export declare function handleWindowSize(fp: Record<string, any>, outerWidth: number, outerHeight: number): void;
|
|
416
|
+
export interface GenerateFingerprintOptions {
|
|
417
|
+
/** Outer window size [width, height], applied after generation. */
|
|
418
|
+
window?: readonly [number, number] | null;
|
|
419
|
+
/** A bound on the generated screen (best-effort, see below). */
|
|
420
|
+
screen?: Screen | null;
|
|
421
|
+
/** Camoufox OS name(s): 'linux', 'macos', 'windows' (or lin/mac/win). */
|
|
422
|
+
os?: string | readonly string[] | null;
|
|
423
|
+
/** Any other fpgen conditions. */
|
|
424
|
+
[condition: string]: any;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Generates a Firefox fingerprint with fpgen (the model must be installed:
|
|
428
|
+
* `await ensureModel()` from fpgen).
|
|
429
|
+
*
|
|
430
|
+
* `screen` bounds the generated screen; `window` overrides the outer window
|
|
431
|
+
* size afterwards; `os` is Camoufox's name for the platform; anything else is
|
|
432
|
+
* passed to fpgen as a condition.
|
|
433
|
+
*/
|
|
434
|
+
export declare function generateFingerprint({ window, screen, os, ...conditions }?: GenerateFingerprintOptions): Record<string, any>;
|