camoucore 0.2.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-files/antibot-rules.json +146 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.js +4 -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.d.ts +2 -0
- package/dist/host.js +17 -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 +16 -0
- package/dist/passthrough.js +50 -0
- package/dist/product.js +1 -1
- package/dist/settings.d.ts +12 -0
- package/dist/settings.js +95 -0
- package/dist/telemetry.d.ts +127 -0
- package/dist/telemetry.js +426 -0
- 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,158 @@
|
|
|
1
|
+
import { VirtualDisplay } from "../virtdisplay.js";
|
|
2
|
+
/** Names the card when the `gpu` launch option is not given. */
|
|
3
|
+
export declare const GPU_ENV_VAR = "CAMOUFOX_GPU";
|
|
4
|
+
/**
|
|
5
|
+
* How long the browser has to render on the GPU after the probe page starts
|
|
6
|
+
* drawing. A card busy with other work took 5-10s in Holo's measurements.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GPU_WAIT_S = 30;
|
|
9
|
+
export declare const GPU_WAIT_ENV_VAR = "CAMOUFOX_GPU_WAIT_S";
|
|
10
|
+
/**
|
|
11
|
+
* The root window is not observable (screen.* is spoofed per context), but
|
|
12
|
+
* the GPU compositor needs a real surface, so it is not 1x1 like Xvfb's.
|
|
13
|
+
*/
|
|
14
|
+
export declare const GPU_SCREEN = "1920x1080x24";
|
|
15
|
+
/** Where Xorg looks up a relative -config when the setuid wrapper elevates it. */
|
|
16
|
+
export declare const SYSTEM_CONFIG_DIR = "/etc/X11";
|
|
17
|
+
export declare const XWRAPPER_CONFIG = "/etc/X11/Xwrapper.config";
|
|
18
|
+
export declare const XWRAPPER_SETTINGS: Readonly<Record<string, string>>;
|
|
19
|
+
export declare const XORG_WRAPPERS: readonly ["/usr/lib/xorg/Xorg.wrap", "/usr/libexec/Xorg.wrap"];
|
|
20
|
+
/**
|
|
21
|
+
* -terminate: the server exits this many seconds after its last client leaves.
|
|
22
|
+
* -sharevts: never take a VT of its own, which blanks a live desktop.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SERVER_FLAGS: readonly ["-terminate", "2", "-nolisten", "tcp", "-sharevts", "-novtswitch"];
|
|
25
|
+
/**
|
|
26
|
+
* Firefox's GPU paths, on by default for this display only; the caller's prefs
|
|
27
|
+
* win. webgl.force-enabled is set by every launch already. Forcing the
|
|
28
|
+
* accelerated canvas made 2D canvas match Windows Firefox on the same card.
|
|
29
|
+
*/
|
|
30
|
+
export declare const GPU_PREFS: Record<string, boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Draws one WebGL frame per animation frame: Firefox opens the GPU only when
|
|
33
|
+
* something renders.
|
|
34
|
+
*/
|
|
35
|
+
export declare const PROBE_PAGE: string;
|
|
36
|
+
/** A GPU with a DRM render node, as sysfs describes it. */
|
|
37
|
+
export interface GpuDevice {
|
|
38
|
+
pciAddress: string;
|
|
39
|
+
renderNode: string;
|
|
40
|
+
cardNode: string | null;
|
|
41
|
+
vendorId: string;
|
|
42
|
+
deviceId: string;
|
|
43
|
+
kernelDriver: string;
|
|
44
|
+
/** /dev/nvidia<minor> for the NVIDIA driver, which renders through it. */
|
|
45
|
+
nvidiaNode: string | null;
|
|
46
|
+
}
|
|
47
|
+
export declare function gpuVendor(gpu: GpuDevice): string;
|
|
48
|
+
/** Xorg's BusID: decimal bus:device:function, without the domain. */
|
|
49
|
+
export declare function busId(gpu: GpuDevice): string;
|
|
50
|
+
/** modesetting drives any KMS device with glamor; NVIDIA needs its own. */
|
|
51
|
+
export declare function xorgDriver(gpu: GpuDevice): string;
|
|
52
|
+
/** Whether a DRM file's usage stats (its fdinfo) show time on a GPU engine. */
|
|
53
|
+
/**
|
|
54
|
+
* Whether a DRM file's usage stats (its fdinfo) show work on a GPU engine.
|
|
55
|
+
*
|
|
56
|
+
* Drivers report busy time (drm-engine-<engine>: <n> ns; amdgpu, i915) or busy
|
|
57
|
+
* cycles (drm-cycles-<engine>: <n>; xe reports only these). drm-total-cycles
|
|
58
|
+
* counts the GPU's clock whether this client used it or not, so it is not work.
|
|
59
|
+
*/
|
|
60
|
+
export declare function drewOnGpu(fdinfo: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The card's render node and its primary node. Firefox's GPU work is accounted
|
|
63
|
+
* to whichever it was handed: a second launch from one process on an RX 7900
|
|
64
|
+
* XTX drew through /dev/dri/card0, not renderD128.
|
|
65
|
+
*/
|
|
66
|
+
export declare function drmNodes(gpu: GpuDevice): string[];
|
|
67
|
+
export declare function describeGpu(gpu: GpuDevice): string;
|
|
68
|
+
/**
|
|
69
|
+
* The GPUs with a render node and a PCI address, in PCI address order.
|
|
70
|
+
*
|
|
71
|
+
* Ordered by PCI address, not render node number: render nodes are numbered in
|
|
72
|
+
* the order the drivers loaded, which can change from one boot to the next.
|
|
73
|
+
*/
|
|
74
|
+
export declare function enumerateGpus(root?: string): GpuDevice[];
|
|
75
|
+
/**
|
|
76
|
+
* The one GPU `selector` (or CAMOUFOX_GPU) names.
|
|
77
|
+
*
|
|
78
|
+
* A selector is an index into enumerateGpus(), a render or card node (name or
|
|
79
|
+
* /dev/dri path), a PCI address or part of one, vendor:device ids, or a vendor
|
|
80
|
+
* name. Without one, the host must have exactly one GPU.
|
|
81
|
+
*/
|
|
82
|
+
export declare function selectGpu(selector?: string | number | null, gpus?: GpuDevice[]): GpuDevice;
|
|
83
|
+
/**
|
|
84
|
+
* An xorg.conf that drives `gpu` with a virtual screen and no outputs.
|
|
85
|
+
*
|
|
86
|
+
* `UseDisplayDevice "None"` keeps the NVIDIA driver off every connector, so it
|
|
87
|
+
* needs no DRM master and coexists with a desktop on the same card.
|
|
88
|
+
*/
|
|
89
|
+
export declare function xorgConfig(gpu: GpuDevice, screen?: string): string;
|
|
90
|
+
/** The config's file name in /etc/X11, keyed by PCI address. */
|
|
91
|
+
export declare function configName(gpu: GpuDevice): string;
|
|
92
|
+
/** The one command that sets this machine up for `gpu`. */
|
|
93
|
+
export declare function setupCommand(gpu: GpuDevice): string;
|
|
94
|
+
/**
|
|
95
|
+
* A root shell script that sets this machine up for headless="virtual-gpu" on
|
|
96
|
+
* `gpu`: Xorg and its setuid wrapper, the wrapper's settings, and the card's
|
|
97
|
+
* config. Safe to run again.
|
|
98
|
+
*/
|
|
99
|
+
export declare function setupScript(gpu: GpuDevice): string;
|
|
100
|
+
/** What keeps Xorg.wrap from starting Xorg for this user, if anything. */
|
|
101
|
+
export declare function setupProblems(): string[];
|
|
102
|
+
/**
|
|
103
|
+
* A headless Xorg server on one GPU, for headless="virtual-gpu".
|
|
104
|
+
*
|
|
105
|
+
* As root, Xorg takes a temporary config and log. Otherwise it runs through
|
|
106
|
+
* the setuid Xorg.wrap, which accepts only a config name relative to /etc/X11
|
|
107
|
+
* and no -logfile, so the config is installed there once.
|
|
108
|
+
*/
|
|
109
|
+
export declare class GpuDisplay extends VirtualDisplay {
|
|
110
|
+
/** Where the config is installed for the setuid wrapper. */
|
|
111
|
+
static configDir: string;
|
|
112
|
+
/** Xorg.wrap's settings. */
|
|
113
|
+
static xwrapperConfig: string;
|
|
114
|
+
/** Where the setuid wrapper may be installed. */
|
|
115
|
+
static xorgWrappers: readonly string[];
|
|
116
|
+
gpu: GpuDevice;
|
|
117
|
+
requireGpu: boolean;
|
|
118
|
+
private client;
|
|
119
|
+
private tempFiles;
|
|
120
|
+
private vt;
|
|
121
|
+
private vtTaken;
|
|
122
|
+
constructor(gpu: GpuDevice, debug?: boolean, requireGpu?: boolean);
|
|
123
|
+
get xorgPath(): string;
|
|
124
|
+
/** A failed start, with what the machine is missing when that is why. */
|
|
125
|
+
protected error(message: string): Error;
|
|
126
|
+
protected wrapper(): string[];
|
|
127
|
+
protected command(): string[];
|
|
128
|
+
protected serverEnv(): NodeJS.ProcessEnv;
|
|
129
|
+
private get log();
|
|
130
|
+
get(): Promise<string>;
|
|
131
|
+
protected ready(): Promise<void>;
|
|
132
|
+
private failVt;
|
|
133
|
+
/** Every process started with DISPLAY set to this display, except Xorg and us. */
|
|
134
|
+
private displayProcesses;
|
|
135
|
+
/**
|
|
136
|
+
* Whether a process on this display renders on the GPU.
|
|
137
|
+
*
|
|
138
|
+
* Firefox opens the card's DRM nodes for DMABuf even when it renders in
|
|
139
|
+
* software, so an open render node proves nothing. Rendering is the NVIDIA
|
|
140
|
+
* driver's /dev/nvidia<minor> held open, or work the kernel accounted to a
|
|
141
|
+
* GPU engine on one of the card's DRM nodes.
|
|
142
|
+
*/
|
|
143
|
+
usesGpu(): boolean;
|
|
144
|
+
waitForGpu(): Promise<boolean>;
|
|
145
|
+
/** Throw, or warn with require_gpu: false, when the browser did not use the GPU. */
|
|
146
|
+
checkGpu(active: boolean): void;
|
|
147
|
+
kill(): void;
|
|
148
|
+
}
|
|
149
|
+
/** Something that opens pages: a Browser or a BrowserContext. */
|
|
150
|
+
interface PageOpener {
|
|
151
|
+
newPage(): Promise<{
|
|
152
|
+
goto(url: string): Promise<unknown>;
|
|
153
|
+
close(): Promise<void>;
|
|
154
|
+
}>;
|
|
155
|
+
}
|
|
156
|
+
/** Draw in a page of `target` and check the browser rendered on the GPU. */
|
|
157
|
+
export declare function proveGpu(target: PageOpener, display: GpuDisplay): Promise<void>;
|
|
158
|
+
export {};
|