bexxcv 1.1.0 → 1.1.2
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/README.md +267 -412
- package/dist/__version__.js +1 -1
- package/dist/fingerprints.d.ts +27 -2
- package/dist/fingerprints.js +122 -15
- package/dist/human_behavior.d.ts +20 -0
- package/dist/human_behavior.js +107 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +4 -0
- package/dist/locale.js +7 -3
- package/dist/pkgman.js +5 -3
- package/dist/plugins/dodge.js +5 -2
- package/dist/plugins/gauntlet.d.ts +1 -0
- package/dist/plugins/gauntlet.js +8 -2
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/lens.js +77 -0
- package/dist/schema.js +11 -2
- package/dist/session.d.ts +26 -0
- package/dist/session.js +96 -0
- package/dist/turnstile.d.ts +2 -0
- package/dist/turnstile.js +8 -1
- package/dist/uam.d.ts +15 -1
- package/dist/uam.js +44 -81
- package/dist/utils.d.ts +12 -3
- package/dist/utils.js +177 -3
- package/dist/virtdisplay.js +23 -4
- package/dist/webgl/profiles.d.ts +12 -0
- package/dist/webgl/profiles.js +181 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# bexxcv
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Headless Firefox automation with realistic browser fingerprints, built on top of [Camoufox](https://github.com/daijro/camoufox).
|
|
4
4
|
|
|
5
|
-
> **Fork notice:** Forked from [camoufox-js](https://github.com/apify/camoufox-js) by [Apify]
|
|
5
|
+
> **Fork notice:** Forked from [camoufox-js](https://github.com/apify/camoufox-js) by [Apify]. Full credit to the original authors for the architecture, fingerprint generation pipeline, and Playwright integration. This fork adds entropy improvements, GPU-aware WebGL sampling, session management, and ergonomic enhancements.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -11,24 +11,21 @@ High-performance stealth Firefox automation built on top of [Camoufox](https://g
|
|
|
11
11
|
| Area | Original | bexxcv |
|
|
12
12
|
|---|---|---|
|
|
13
13
|
| IP resolution | Sequential fallback (up to 6s on cold start) | `Promise.any()` — all endpoints race, fastest wins |
|
|
14
|
-
|
|
|
15
|
-
| `
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
| Human behavior | Cursor movement only (`humanize`) | `createHuman(page)` — clicks, typing with typos, scrolling, idle drift |
|
|
30
|
-
| Launch speed | Sequential setup | Public IP lookup runs in parallel with the binary check; telemetry and update prefs off by default |
|
|
31
|
-
| Fingerprint coherence | `devicePixelRatio` picked independently of screen size | DPR is chosen so CSS size times DPR matches a real monitor resolution |
|
|
14
|
+
| Randomness source | `Math.random()` | `crypto.getRandomValues()` everywhere |
|
|
15
|
+
| `window.devicePixelRatio` | Not injected (always 1.0) | Injected per-OS from real-world telemetry distribution |
|
|
16
|
+
| DPR coherence | Chosen independently of screen size | Selected so CSS × DPR matches a known monitor resolution |
|
|
17
|
+
| Window position | Perfectly centered | Organic ±20px jitter + upper-biased Y placement |
|
|
18
|
+
| Download retries | Flat delay | Exponential backoff with crypto jitter (2s → 4s → 8s → max 30s) |
|
|
19
|
+
| Xvfb trigger | `headless: "virtual"` only | `headless: false` auto-starts Xvfb when `$DISPLAY` is unset |
|
|
20
|
+
| WebGL sampling | `Math.random()` for weighted choice | `crypto.getRandomValues()` with OS-weighted GPU profiles |
|
|
21
|
+
| Turnstile solver | Manual | `turnstile: true` — background checkbox clicker per page |
|
|
22
|
+
| Cloudflare UAM | Manual | `uam: true` — waits until challenge clears before continuing |
|
|
23
|
+
| Human behavior | Cursor movement only (`humanize`) | `attachHumanBehavior(page)` — typed sessions with drift, typos, fatigue |
|
|
24
|
+
| Launch speed | Sequential setup | Public IP lookup runs in parallel with binary check; telemetry off by default |
|
|
25
|
+
| Fingerprint seeds | Plain random | Audio, canvas, font-spacing, WebGL vendor/renderer from per-GPU database |
|
|
26
|
+
| Hardware concurrency | Fixed / not spoofed | Spoofed from realistic pool per target OS |
|
|
27
|
+
| Device memory | Not set | Injected from fingerprint-derived multiplier |
|
|
28
|
+
| Timezone | Exact UTC offset | ±15 min jitter for realism |
|
|
32
29
|
|
|
33
30
|
---
|
|
34
31
|
|
|
@@ -36,7 +33,7 @@ High-performance stealth Firefox automation built on top of [Camoufox](https://g
|
|
|
36
33
|
|
|
37
34
|
- Node.js >= 22
|
|
38
35
|
- `playwright-core` < 1.63.0
|
|
39
|
-
- Linux headless: `Xvfb` (
|
|
36
|
+
- Linux headless: `Xvfb` (install via package manager if needed)
|
|
40
37
|
|
|
41
38
|
---
|
|
42
39
|
|
|
@@ -48,7 +45,7 @@ npm install bexxcv playwright-core
|
|
|
48
45
|
pnpm add bexxcv playwright-core
|
|
49
46
|
```
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
Fetch the Camoufox browser binary after installing:
|
|
52
49
|
|
|
53
50
|
```bash
|
|
54
51
|
npx bexxcv fetch
|
|
@@ -67,56 +64,63 @@ await page.goto("https://example.com");
|
|
|
67
64
|
await browser.close();
|
|
68
65
|
```
|
|
69
66
|
|
|
70
|
-
On a headless Linux server
|
|
67
|
+
On a headless Linux server without `$DISPLAY`, Xvfb starts automatically when `headless` is `false` or unset — no `xvfb-run` wrapper required.
|
|
71
68
|
|
|
72
69
|
---
|
|
73
70
|
|
|
74
|
-
##
|
|
71
|
+
## Options
|
|
75
72
|
|
|
76
73
|
```ts
|
|
77
74
|
const browser = await bexxcv({
|
|
78
|
-
// ---
|
|
79
|
-
headless: false,
|
|
80
|
-
auto_xvfb: true,
|
|
75
|
+
// --- Display ---
|
|
76
|
+
headless: false, // false | true | "virtual"
|
|
77
|
+
auto_xvfb: true, // auto-start Xvfb on Linux without $DISPLAY
|
|
81
78
|
|
|
82
79
|
// --- OS targeting ---
|
|
83
|
-
os: "windows",
|
|
84
|
-
|
|
85
|
-
// --- Fingerprint ---
|
|
86
|
-
fingerprint: undefined,
|
|
87
|
-
ff_version: undefined,
|
|
88
|
-
screen: undefined,
|
|
89
|
-
window: undefined,
|
|
90
|
-
webgl_config: undefined,
|
|
80
|
+
os: "windows", // "linux" | "macos" | "windows" | array
|
|
81
|
+
|
|
82
|
+
// --- Fingerprint customization ---
|
|
83
|
+
fingerprint: undefined, // pass a custom Fingerprint object
|
|
84
|
+
ff_version: undefined, // override Firefox version in UA string
|
|
85
|
+
screen: undefined, // { maxWidth, maxHeight } — constrain physical screen
|
|
86
|
+
window: undefined, // [width, height] — fix outer window dimensions
|
|
87
|
+
webgl_config: undefined, // [vendor, renderer] — pick specific WebGL pair
|
|
88
|
+
hardware_concurrency_override: undefined, // override CPU thread count
|
|
89
|
+
device_memory_override: undefined, // override navigator.deviceMemory
|
|
90
|
+
timezone_jitter: true, // ±15 min offset noise (default on)
|
|
91
|
+
perf_jitter: true, // performance.now() clock drift (default on)
|
|
92
|
+
session_stickiness: true, // keep values consistent within a session (default on)
|
|
91
93
|
|
|
92
94
|
// --- Network / locale ---
|
|
93
|
-
geoip: true,
|
|
94
|
-
locale: "en-US",
|
|
95
|
+
geoip: true, // true = detect public IP; string = use specific IP
|
|
96
|
+
locale: "en-US", // BCP 47 locale string or array
|
|
95
97
|
proxy: "http://user:pass@host:port",
|
|
96
98
|
|
|
97
99
|
// --- Privacy toggles ---
|
|
98
|
-
block_webrtc: false,
|
|
99
|
-
block_images: false,
|
|
100
|
-
block_webgl: false,
|
|
101
|
-
disable_coop: false,
|
|
100
|
+
block_webrtc: false, // disable WebRTC (prevents STUN-based IP leaks)
|
|
101
|
+
block_images: false, // disable image loading
|
|
102
|
+
block_webgl: false, // disable WebGL entirely
|
|
103
|
+
disable_coop: false, // disable Cross-Origin-Opener-Policy
|
|
102
104
|
|
|
103
105
|
// --- Browser behavior ---
|
|
104
|
-
humanize: false,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
humanize: false, // true | number(ms) — random mouse delays
|
|
107
|
+
turnstile: false, // auto-click Turnstile checkboxes
|
|
108
|
+
uam: false, // wait out Cloudflare UAM challenges
|
|
109
|
+
enable_cache: false, // enable disk + memory cache
|
|
110
|
+
main_world_eval: false, // allow JS eval in main world
|
|
111
|
+
|
|
112
|
+
// --- Addons & fonts ---
|
|
113
|
+
addons: [], // paths to Firefox extension XPIs
|
|
114
|
+
exclude_addons: [], // built-in addon keys to skip
|
|
115
|
+
fonts: [], // additional font names to inject
|
|
116
|
+
custom_fonts_only: false, // strip built-in fonts, use only your list
|
|
113
117
|
|
|
114
118
|
// --- Low-level ---
|
|
115
|
-
executable_path: undefined,
|
|
116
|
-
firefox_user_prefs: {},
|
|
117
|
-
args: [],
|
|
118
|
-
env: {},
|
|
119
|
-
debug: false,
|
|
119
|
+
executable_path: undefined, // path to a custom Firefox binary
|
|
120
|
+
firefox_user_prefs: {}, // raw Firefox about:config prefs
|
|
121
|
+
args: [], // extra CLI args passed to Firefox
|
|
122
|
+
env: {}, // extra environment variables
|
|
123
|
+
debug: false, // print full config before launch
|
|
120
124
|
});
|
|
121
125
|
```
|
|
122
126
|
|
|
@@ -124,471 +128,357 @@ const browser = await bexxcv({
|
|
|
124
128
|
|
|
125
129
|
| Value | Behavior |
|
|
126
130
|
|---|---|
|
|
127
|
-
| `true` | Pure headless — no display
|
|
131
|
+
| `true` | Pure headless — no display needed |
|
|
128
132
|
| `false` (default) | Visible window. On Linux with no `$DISPLAY`, auto-starts Xvfb |
|
|
129
|
-
| `"virtual"` | Explicit virtual display
|
|
130
|
-
|
|
131
|
-
### `auto_xvfb`
|
|
132
|
-
|
|
133
|
-
Controls automatic Xvfb lifecycle. Only relevant on Linux.
|
|
134
|
-
|
|
135
|
-
| Condition | Result |
|
|
136
|
-
|---|---|
|
|
137
|
-
| Linux, no `$DISPLAY`, `headless !== true`, `auto_xvfb: true` | Xvfb starts; display injected as `$DISPLAY` |
|
|
138
|
-
| Linux, `$DISPLAY` set | Real display used, Xvfb skipped |
|
|
139
|
-
| `headless: true` | No display needed at all, Xvfb never starts |
|
|
140
|
-
| `auto_xvfb: false` | You manage the display manually |
|
|
133
|
+
| `"virtual"` | Explicit virtual display regardless of `$DISPLAY` state |
|
|
141
134
|
|
|
142
135
|
### `os`
|
|
143
136
|
|
|
144
|
-
|
|
137
|
+
Restricts the fingerprint generator to browsers seen on the given OS(es). Affects UA string, `navigator.platform`, `navigator.oscpu`, screen dimensions, and font set.
|
|
145
138
|
|
|
146
139
|
```ts
|
|
147
140
|
await bexxcv({ os: "windows" });
|
|
148
141
|
await bexxcv({ os: ["windows", "macos"] });
|
|
149
142
|
```
|
|
150
143
|
|
|
151
|
-
This affects UA string, navigator.platform, navigator.oscpu, screen dimensions, and font set.
|
|
152
|
-
|
|
153
144
|
### `geoip`
|
|
154
145
|
|
|
155
|
-
|
|
146
|
+
Detects the server's public IP and aligns geolocation fields (timezone, locale, language headers). Combine with `proxy` to match the proxy exit node.
|
|
156
147
|
|
|
157
148
|
```ts
|
|
158
|
-
await bexxcv({ geoip: true });
|
|
159
|
-
await bexxcv({ geoip: "203.0.113.45" });
|
|
149
|
+
await bexxcv({ geoip: true });
|
|
150
|
+
await bexxcv({ geoip: "203.0.113.45" });
|
|
151
|
+
await bexxcv({ proxy: "socks5://user:pass@proxy.example.com:1080", geoip: true });
|
|
160
152
|
```
|
|
161
153
|
|
|
162
|
-
Requires the optional `geoip2` extra.
|
|
154
|
+
Requires the optional `geoip2` extra.
|
|
155
|
+
|
|
156
|
+
### `screen`
|
|
157
|
+
|
|
158
|
+
Constrains the generated physical screen size. The width/height are treated as physical pixel bounds; the final CSS pixels depend on the selected DPR.
|
|
163
159
|
|
|
164
160
|
```ts
|
|
165
|
-
await bexxcv({
|
|
166
|
-
proxy: "socks5://user:pass@proxy.example.com:1080",
|
|
167
|
-
geoip: true,
|
|
168
|
-
});
|
|
161
|
+
await bexxcv({ screen: { maxWidth: 1920, maxHeight: 1080 } });
|
|
169
162
|
```
|
|
170
163
|
|
|
171
164
|
### `webgl_config`
|
|
172
165
|
|
|
173
|
-
Override the WebGL vendor/renderer pair
|
|
166
|
+
Override the WebGL vendor/renderer pair. Use the exported helper to list valid combinations:
|
|
174
167
|
|
|
175
168
|
```ts
|
|
169
|
+
import { getPossiblePairs, sampleGPUProfile, KNOWN_GPUS } from "bexxcv";
|
|
170
|
+
// or
|
|
176
171
|
await bexxcv({ webgl_config: ["Intel Inc.", "Intel Iris OpenGL Engine"] });
|
|
177
172
|
```
|
|
178
173
|
|
|
179
|
-
Use `getPossiblePairs()` to list all valid combinations for each OS:
|
|
180
|
-
|
|
181
|
-
```ts
|
|
182
|
-
import { launchOptions } from "bexxcv";
|
|
183
|
-
// or access via the webgl module directly:
|
|
184
|
-
import { getPossiblePairs } from "bexxcv/webgl"; // if you re-export it
|
|
185
|
-
```
|
|
186
|
-
|
|
187
174
|
### `turnstile`
|
|
188
175
|
|
|
189
|
-
Background solver for Cloudflare Turnstile checkboxes
|
|
176
|
+
Background solver for Cloudflare Turnstile checkboxes.
|
|
190
177
|
|
|
191
178
|
```ts
|
|
192
179
|
const browser = await bexxcv({ turnstile: true });
|
|
193
|
-
const page = await browser.newPage();
|
|
194
|
-
await page.goto("https://example.com");
|
|
195
180
|
```
|
|
196
181
|
|
|
197
|
-
|
|
198
|
-
|---|---|---|
|
|
199
|
-
| `interval` | `1000` | Milliseconds between widget checks |
|
|
200
|
-
| `retryAfter` | `8000` | Minimum milliseconds before the same unsolved widget is clicked again |
|
|
201
|
-
|
|
202
|
-
Pass `turnstile: { interval: 500, retryAfter: 6000 }` to tune it.
|
|
182
|
+
Per-page loop. Looks for `cf-turnstile-response` inputs, clicks the checkbox area, scrolls into view if needed, and skips already-solved widgets. Works alongside `humanize`.
|
|
203
183
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- One loop per page, including pages opened later, and it stops when the page closes.
|
|
207
|
-
- It looks for `cf-turnstile-response` inputs and clicks the left side of the widget, where the checkbox is. If none exist it falls back to empty `div` elements about 300px wide.
|
|
208
|
-
- Widgets that already hold a token are skipped, and widgets outside the viewport are scrolled into view first.
|
|
209
|
-
- The pointer moves in several steps and the button is held briefly. Combine it with `humanize: true` for more natural cursor paths.
|
|
184
|
+
Options: `{ interval: 1000, retryAfter: 8000 }` (defaults shown).
|
|
210
185
|
|
|
211
186
|
### `uam`
|
|
212
187
|
|
|
213
|
-
Waits out
|
|
188
|
+
Waits out Cloudflare "Just a moment" pages.
|
|
214
189
|
|
|
215
190
|
```ts
|
|
216
191
|
const browser = await bexxcv({ uam: true });
|
|
217
|
-
const page = await browser.newPage();
|
|
218
|
-
await page.goto("https://example.com");
|
|
219
192
|
```
|
|
220
193
|
|
|
221
|
-
|
|
222
|
-
|---|---|---|
|
|
223
|
-
| `timeout` | `30000` | Maximum milliseconds to wait for a challenge to clear |
|
|
224
|
-
| `interval` | `1500` | Milliseconds between background checks for a new challenge |
|
|
225
|
-
| `waitOnGoto` | `true` | Make `page.goto()` resolve only after the challenge clears |
|
|
226
|
-
|
|
227
|
-
How it works:
|
|
228
|
-
|
|
229
|
-
- While the challenge title is shown, the mouse moves and the page scrolls with real input events.
|
|
230
|
-
- After the title changes it waits for `cf_clearance` to stay stable and `cf_chl_rc_ni` to disappear.
|
|
231
|
-
- Pages without a challenge return immediately, so there is no added delay.
|
|
232
|
-
- Challenges that start from clicks or reloads are handled by the background loop.
|
|
194
|
+
Options: `{ timeout: 30000, interval: 1500, waitOnGoto: true }`. Pages without a challenge return immediately.
|
|
233
195
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```ts
|
|
237
|
-
import { waitForUam } from "bexxcv";
|
|
238
|
-
|
|
239
|
-
const result = await waitForUam(page, { timeout: 20000 });
|
|
240
|
-
console.log(result.challenged, result.bypassed, result.cookie);
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
`turnstile` and `uam` can be enabled together.
|
|
196
|
+
Can be combined with `turnstile`.
|
|
244
197
|
|
|
245
198
|
---
|
|
246
199
|
|
|
247
|
-
##
|
|
200
|
+
## Session API
|
|
201
|
+
|
|
202
|
+
Bexxcv maintains per-page session state for consistent fingerprinting and human-like behavior across multiple page navigations.
|
|
248
203
|
|
|
249
204
|
```ts
|
|
250
|
-
import {
|
|
205
|
+
import { attachHumanBehavior, getSessionInfo, initSession, advancePage, endSession } from "bexxcv";
|
|
251
206
|
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
headless: false,
|
|
255
|
-
});
|
|
207
|
+
const browser = await bexxcv({ headless: true });
|
|
208
|
+
const page = await browser.newPage();
|
|
256
209
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
await context.close();
|
|
260
|
-
```
|
|
210
|
+
// Initialize a session tied to this page
|
|
211
|
+
initSession(page);
|
|
261
212
|
|
|
262
|
-
|
|
213
|
+
// Attach human-like behavior (mouse drift, typing delays, page transition pacing)
|
|
214
|
+
attachHumanBehavior(page, { speed: 1, idleDrift: true });
|
|
263
215
|
|
|
264
|
-
|
|
216
|
+
await page.goto("https://example.com/page1");
|
|
217
|
+
advancePage(page); // increment session page counter
|
|
265
218
|
|
|
266
|
-
|
|
219
|
+
const info = getSessionInfo(page);
|
|
220
|
+
console.log(info.id, info.pageCount, info.ageMs);
|
|
267
221
|
|
|
268
|
-
|
|
269
|
-
|
|
222
|
+
await page.goto("https://example.com/page2");
|
|
223
|
+
endSession(page); // clean up
|
|
224
|
+
await browser.close();
|
|
225
|
+
```
|
|
270
226
|
|
|
271
|
-
|
|
272
|
-
const page = await browser.newPage();
|
|
273
|
-
const human = createHuman(page, { speed: 1, typoRate: 0.015 });
|
|
227
|
+
### `initSession(page, options?)`
|
|
274
228
|
|
|
275
|
-
|
|
276
|
-
await human.scrollTo("#login");
|
|
277
|
-
await human.click("#email");
|
|
278
|
-
await human.type(null, "hello@example.com");
|
|
279
|
-
await human.pause();
|
|
280
|
-
await human.scroll(400);
|
|
281
|
-
await human.idle(2000);
|
|
282
|
-
```
|
|
229
|
+
Creates a new session bound to the page. Returns a session ID string. Sessions track a random seed buffer used for reproducible seeded randomness across page loads.
|
|
283
230
|
|
|
284
|
-
|
|
285
|
-
|---|---|
|
|
286
|
-
| `click(selectorOrPoint)` | Lands at a random point inside the element, hovers briefly, then presses and releases |
|
|
287
|
-
| `type(selector \| null, text)` | Variable delay per key, longer pauses after spaces and punctuation, occasional typo that is corrected |
|
|
288
|
-
| `scroll(deltaY)` | Wheel steps with uneven timing and occasional reading pauses |
|
|
289
|
-
| `scrollTo(selector)` | Scrolls until the element is near the middle of the viewport |
|
|
290
|
-
| `moveTo(x, y)` | Moves the pointer |
|
|
291
|
-
| `pause(min, max)` | Log-normal think time in milliseconds |
|
|
292
|
-
| `idle(ms)` | Small pointer drift |
|
|
231
|
+
Options: `{ timeout?: number, maxPages?: number, seedLength?: number }`
|
|
293
232
|
|
|
294
|
-
|
|
295
|
-
|---|---|---|
|
|
296
|
-
| `speed` | `1` | Higher is faster, from `0.2` to `20` |
|
|
297
|
-
| `nativeCursor` | `true` | Let `humanize` move the cursor. Set `false` to draw Bezier paths from JavaScript |
|
|
298
|
-
| `typoRate` | `0.015` | Probability of a typo per letter, `0` disables |
|
|
233
|
+
### `getSessionId(page)`
|
|
299
234
|
|
|
300
|
-
|
|
235
|
+
Returns the current session ID for a page, or `null` if none exists.
|
|
301
236
|
|
|
302
|
-
|
|
237
|
+
### `advancePage(page)`
|
|
303
238
|
|
|
304
|
-
|
|
239
|
+
Increments the page counter for the active session. Called automatically by `attachHumanBehavior` during navigation.
|
|
305
240
|
|
|
306
|
-
|
|
307
|
-
InvalidOptions: Invalid bexxcv options:
|
|
308
|
-
turnstile: expected a boolean or { interval, retryAfter }, got the string "yes"
|
|
309
|
-
```
|
|
241
|
+
### `endSession(page)`
|
|
310
242
|
|
|
311
|
-
|
|
243
|
+
Removes session state from the page and cleans up internal maps.
|
|
312
244
|
|
|
313
|
-
|
|
245
|
+
### `isSessionExpired(page, timeoutMs?)`
|
|
314
246
|
|
|
315
|
-
|
|
247
|
+
Returns `true` if the session age exceeds `timeoutMs` (default 30 minutes).
|
|
316
248
|
|
|
317
|
-
|
|
318
|
-
- WebGL data keys are matched against the properties of the installed Camoufox build. If the bundled `webgl_data.db` uses different key names or keys the browser does not know, bexxcv raises a clear `UnknownProperty` error instead of silently leaking the host GPU.
|
|
249
|
+
### `attachHumanBehavior(page, options?)`
|
|
319
250
|
|
|
320
|
-
|
|
251
|
+
Wraps `page.goto()`, `page.click()`, and `page.evaluate()` with human-like timing. Uses seeded Gaussian drift for idle cursor movement based on the session seed.
|
|
321
252
|
|
|
322
|
-
|
|
253
|
+
Options:
|
|
254
|
+
| Option | Default | Description |
|
|
255
|
+
|---|---|---|
|
|
256
|
+
| `speed` | `1` | Multiplier for all delays (lower = faster) |
|
|
257
|
+
| `typoRate` | `0.015` | Probability of random character errors in typed text |
|
|
258
|
+
| `scrollPattern` | `"natural"` | Scroll pattern type |
|
|
259
|
+
| `idleDrift` | `true` | Subtle cursor drift while idle |
|
|
260
|
+
| `sessionTimeout` | `1800000` | Session expiry in ms |
|
|
261
|
+
| `maxPagesPerSession` | `20` | Max pages before session expires |
|
|
262
|
+
| `pageTransitionMinMs` | `800` | Min delay between page loads |
|
|
263
|
+
| `pageTransitionMaxMs` | `3000` | Max delay between page loads |
|
|
264
|
+
| `mouseAcceleration` | `true` | Accelerate cursor toward targets |
|
|
323
265
|
|
|
324
|
-
|
|
266
|
+
### `detachHumanBehavior(page)`
|
|
325
267
|
|
|
326
|
-
|
|
268
|
+
Reverses the wrappers applied by `attachHumanBehavior`.
|
|
327
269
|
|
|
328
|
-
|
|
329
|
-
node scripts/update-data.mjs --from /path/to/webgl_data.db
|
|
330
|
-
node scripts/update-data.mjs --npm camoufox-js
|
|
331
|
-
node scripts/update-data.mjs --stamp
|
|
332
|
-
node scripts/update-data.mjs --pin
|
|
333
|
-
```
|
|
270
|
+
### `getSessionInfo(page)`
|
|
334
271
|
|
|
335
|
-
|
|
272
|
+
Returns `{ id, pageCount, ageMs }` or `null` if no session exists.
|
|
336
273
|
|
|
337
274
|
---
|
|
338
275
|
|
|
339
|
-
##
|
|
276
|
+
## Fingerprint internals
|
|
340
277
|
|
|
341
|
-
|
|
278
|
+
### GPU profile sampling
|
|
342
279
|
|
|
343
|
-
|
|
344
|
-
import { bexxcv, brake, gauntlet, human, stash, wiretap } from "bexxcv";
|
|
345
|
-
|
|
346
|
-
const browser = await bexxcv(
|
|
347
|
-
{ preset: "realistic", headless: false, os: "windows" },
|
|
348
|
-
[
|
|
349
|
-
gauntlet({ solve: ["uam", "turnstile"], maxTries: 3 }),
|
|
350
|
-
human(),
|
|
351
|
-
stash("./profiles/cookies.json"),
|
|
352
|
-
wiretap("/api/"),
|
|
353
|
-
brake({ maxRps: 2 }),
|
|
354
|
-
],
|
|
355
|
-
);
|
|
356
|
-
```
|
|
280
|
+
Each fingerprint includes a randomly-selected but OS-weighted GPU profile. Known GPUs are stored in `KNOWN_GPUs` per OS, with weights reflecting typical market share. The same GPU profile determines both the `webGl:vendor`/`webGl:renderer` fingerprint properties and the GLSL shader version string.
|
|
357
281
|
|
|
358
|
-
|
|
282
|
+
Optional WebGL extensions are added probabilistically per OS. The full list lives in `src/webgl/profiles.ts` and can be extended.
|
|
359
283
|
|
|
360
|
-
|
|
361
|
-
|---|---|
|
|
362
|
-
| `gauntlet(opts)` | Runs the checks after every `page.goto()`: waits out the Cloudflare challenge (`uam`) and clicks Turnstile widgets (`turnstile`), retrying up to `maxTries`. While the challenge page is up it clicks the widget between mouse movements. `sustain` keeps human-like movement going for a number of milliseconds afterwards. A background check also runs every 1.5 seconds (`watch: false` turns it off), so a challenge that appears later in the session is handled too. Challenges are detected through the `cf-mitigated: challenge` header Cloudflare adds to every challenge page, with the page title as a fallback. Read the outcome with `gauntletResult(page)`. |
|
|
363
|
-
| `uam(opts)` and `turnstile(opts)` | The two halves of `gauntlet` as separate plugins. |
|
|
364
|
-
| `human(opts)` | Replaces `page.click`, `page.fill`, `page.type` and `page.hover` with versions that move the pointer, hold the button, type with uneven timing and occasional corrected typos. Options: `speed`, `typoRate`, `nativeCursor`, `think` (a `[min, max]` pause in milliseconds before each action, or `false`). Locator methods are not replaced. |
|
|
365
|
-
| `stash(file)` | Cookie vault, a file path or `{ file, names, domains, saveEvery }`. Cookies are restored into every new context, expired ones are dropped, and everything is saved per domain when the browser closes. The file is created with mode 600. `cf_clearance` is tied to the device and IP it was issued for, so it is restored only when the proxy matches the one in use when it was saved, while other cookies are always restored. |
|
|
366
|
-
| `cocoon(dir)` | Persistent profile folder (`user_data_dir`) that keeps localStorage, IndexedDB and cache between runs. |
|
|
367
|
-
| `wiretap(match)` | Records matching responses. Pass a substring, a list, or `{ match, methods, bodies, maxBodyBytes, streamTimeout, out, redact }`. Use `re:` plus a regular expression for patterns. Server-sent event streams are split into `events`. Sensitive headers are redacted unless `redact: false`. With `out` the capture is written to a private file when the browser closes, and `wiretapEntries(context)` returns it at any time. |
|
|
368
|
-
| `brake(opts)` | Rate limiter for `page.goto()`: `maxRps` per host, and `Retry-After` is honored after 429 and 503 answers, with exponential backoff when the header is missing. |
|
|
369
|
-
| `dodge(pool)` | Proxy pool: a list of proxy URLs or `{ pool, rotateOn, healthCheck, cooldown, onBlocked }`. Unhealthy proxies are skipped at launch, each new context gets the next proxy, and a proxy that answers a blocked status is paused. Keep the pool in one country, because the timezone and locale are derived from the launch proxy. |
|
|
370
|
-
| `veneer(opts)` | Warns when a Firefox user agent is sent together with `sec-ch-ua` headers. With `{ strict: true }` those headers are stripped. |
|
|
371
|
-
| `lens(opts)` | Local fingerprint audit after the first page load, see below. |
|
|
372
|
-
|
|
373
|
-
Writing a plugin:
|
|
284
|
+
### Screen DPI coherence
|
|
374
285
|
|
|
375
|
-
|
|
376
|
-
const timing = {
|
|
377
|
-
name: "timing",
|
|
378
|
-
onPage(page) {
|
|
379
|
-
page.on("load", () => console.log("loaded", page.url()));
|
|
380
|
-
},
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
const browser = await bexxcv({}, [timing]);
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
A plugin object can have `beforeLaunch`, `beforeContext`, `onContext`, `onPage` and `beforeClose`, and an `order` number that decides the sequence between plugins.
|
|
286
|
+
`devicePixelRatio` is sampled from an OS-specific pool, then validated so that `CSS_width × DPR` and `CSS_height × DPR` each land on a known physical monitor resolution. Invalid combinations receive near-zero weight, making impossible resolutions statistically negligible.
|
|
387
287
|
|
|
388
|
-
###
|
|
288
|
+
### Extended fingerprint fields
|
|
389
289
|
|
|
390
|
-
|
|
290
|
+
Beyond the standard `fingerprint-generator` output, bexxcv adds these internal fields to the generated fingerprint object:
|
|
391
291
|
|
|
392
|
-
|
|
|
393
|
-
|
|
394
|
-
| `
|
|
395
|
-
| `
|
|
396
|
-
| `
|
|
397
|
-
| `
|
|
292
|
+
| Field | Purpose |
|
|
293
|
+
|---|---|
|
|
294
|
+
| `audioSeed` | Seed for audio context fingerprinting |
|
|
295
|
+
| `canvasSeed` | Seed for canvas fingerprint noise patterns |
|
|
296
|
+
| `fontSpacingSeed` | Seed for font measurement spacing jitter |
|
|
297
|
+
| `webglVendor` | Physical GPU vendor name |
|
|
298
|
+
| `webglRenderer` | Physical GPU renderer string |
|
|
299
|
+
| `webglGLSL` | Corresponding GLSL version |
|
|
300
|
+
| `webglExtensions` | Supported WebGL extension list |
|
|
301
|
+
| `hardwareConcurrencySeed` | CPU core count selection |
|
|
302
|
+
| `memoryMultiplier` | RAM multiplier for `navigator.deviceMemory` |
|
|
303
|
+
| `perfJitter` | `performance.now()` clock drift offset |
|
|
304
|
+
| `timezoneOffsetJitter` | Timezone offset shift in seconds |
|
|
305
|
+
| `touchSupport` | Whether touch input is reported |
|
|
306
|
+
| `pointerType` | Primary pointer type ("mouse"/"touch"/"pen") |
|
|
307
|
+
|
|
308
|
+
These fields are consumed during config assembly when the installed Camoufox build supports the corresponding properties (checked against the build's `properties.json`). Older builds that lack a property simply skip it.
|
|
398
309
|
|
|
399
|
-
|
|
310
|
+
---
|
|
400
311
|
|
|
401
|
-
|
|
312
|
+
## Plugins
|
|
402
313
|
|
|
403
|
-
|
|
314
|
+
bexxcv ships a set of pluggable behaviors you can compose:
|
|
404
315
|
|
|
405
|
-
|
|
316
|
+
| Plugin | What it does |
|
|
317
|
+
|---|---|
|
|
318
|
+
| `brake` | Rate-limits requests with exponential backoff |
|
|
319
|
+
| `cocoon` | Persists browser profile data to disk |
|
|
320
|
+
| `dodge` | Rotates through a proxy pool with health checks |
|
|
321
|
+
| `gauntlet` | Runs sustained challenge-solving loops |
|
|
322
|
+
| `human` | Wraps page interactions with human-like timing |
|
|
323
|
+
| `lens` | Audits fingerprint properties for consistency |
|
|
324
|
+
| `stash` | Saves cookies/localStorage to JSON files |
|
|
325
|
+
| `veneer` | Strips unnecessary fingerprint properties |
|
|
326
|
+
| `wiretap` | Logs network request/response details |
|
|
327
|
+
|
|
328
|
+
See individual plugin documentation for configuration options.
|
|
406
329
|
|
|
407
330
|
---
|
|
408
331
|
|
|
409
|
-
##
|
|
332
|
+
## Lens Fingerprint Audit
|
|
410
333
|
|
|
411
|
-
|
|
334
|
+
The `lens` plugin audits the running browser's fingerprint in real time and reports any inconsistencies:
|
|
412
335
|
|
|
413
336
|
```ts
|
|
414
|
-
import {
|
|
415
|
-
// or from the sub-path export:
|
|
416
|
-
import { needsXvfb, startXvfb, withXvfb } from "bexxcv/xvfb";
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
### `needsXvfb(): boolean`
|
|
337
|
+
import { bexxcv, lens, lensReport } from "bexxcv";
|
|
420
338
|
|
|
421
|
-
|
|
339
|
+
const browser = await bexxcv({ headless: true });
|
|
340
|
+
const page = await browser.newPage();
|
|
341
|
+
await page.goto("https://example.com");
|
|
422
342
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
343
|
+
// The lens plugin runs automatically when added to plugins
|
|
344
|
+
const report = lensReport(page);
|
|
345
|
+
if (report) {
|
|
346
|
+
console.log(`Score: ${report.score}/100`);
|
|
347
|
+
for (const check of report.checks) {
|
|
348
|
+
if (!check.ok) console.log(` ❌ ${check.id}: ${check.detail}`);
|
|
349
|
+
}
|
|
426
350
|
}
|
|
427
351
|
```
|
|
428
352
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
Start a virtual display manually. Returns the display string (e.g. `:99`) and a `kill()` function.
|
|
353
|
+
Run the audit manually on any page:
|
|
432
354
|
|
|
433
355
|
```ts
|
|
434
|
-
|
|
435
|
-
console.log(`Virtual display: ${display}`);
|
|
356
|
+
import { auditFingerprint } from "bexxcv";
|
|
436
357
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
kill();
|
|
358
|
+
const report = await auditFingerprint(page);
|
|
440
359
|
```
|
|
441
360
|
|
|
442
|
-
###
|
|
443
|
-
|
|
444
|
-
Start a virtual display, run your callback, then kill the display automatically — even if the callback throws.
|
|
445
|
-
|
|
446
|
-
```ts
|
|
447
|
-
await withXvfb(async (display) => {
|
|
448
|
-
console.log(`Running on ${display}`);
|
|
449
|
-
// launch browsers, run tests, etc.
|
|
450
|
-
});
|
|
451
|
-
```
|
|
361
|
+
### Checks performed
|
|
452
362
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
363
|
+
| Check ID | What it validates |
|
|
364
|
+
|---|---|
|
|
365
|
+
| `webdriver` | `navigator.webdriver` is `undefined` / falsy |
|
|
366
|
+
| `ua-platform` | `navigator.platform` matches OS in UA string |
|
|
367
|
+
| `language` | First language in `navigator.languages` equals `navigator.language` |
|
|
368
|
+
| `locale-intl` | `Intl.DateTimeFormat()` locale matches `navigator.language` prefix |
|
|
369
|
+
| `dpr-screen` | CSS × DPR lands on a known physical monitor resolution |
|
|
370
|
+
| `window-size` | inner ≤ outer ≤ screen + 16 px (Chrome frame buffer) |
|
|
371
|
+
| `cores` | hardwareConcurrency is a plausible CPU core count |
|
|
372
|
+
| `touch` | `maxTouchPoints` is 0 on desktop UAs |
|
|
373
|
+
| `webgl` | WebGL vendor/renderer are present and non-null |
|
|
374
|
+
| `webgl-software` | Renderer is not a software fallback (llvmpipe/swiftshader) |
|
|
375
|
+
| `native-code` | Core APIs have `[native code]` toString output |
|
|
376
|
+
| `ua-hints` | `userAgentData` absent for Firefox, present for Chrome-like UAs |
|
|
377
|
+
| `chrome-object` | `window.chrome` absent for Firefox |
|
|
378
|
+
| `pdf-viewer` | `navigator.pdfViewerEnabled` is `true` on Firefox |
|
|
379
|
+
| `focus` | Page is focused and visible |
|
|
380
|
+
| `media-devices` | At least one media device or headless timeout fallback |
|
|
381
|
+
| `audio-sample-rate` | `AudioContext.sampleRate` is 44100 or 48000 |
|
|
382
|
+
| `fonts-enumerated` | `document.fonts.size > 0` and no load error |
|
|
383
|
+
| `webgl-shader-precision` | Highp float shader precision ≥ 23 (desktop GPU) |
|
|
384
|
+
| `client-hints-platform` | `userAgentData.platform` consistent with `navigator.platform` |
|
|
469
385
|
|
|
470
386
|
---
|
|
471
387
|
|
|
472
|
-
##
|
|
388
|
+
## Context Isolation
|
|
473
389
|
|
|
474
|
-
|
|
390
|
+
Every Playwright `browserContext` gets an independent fingerprint, storage, and cookies. Cross-context leakage is guarded by test coverage:
|
|
475
391
|
|
|
476
|
-
|
|
392
|
+
```ts
|
|
393
|
+
import { Camoufox } from "bexxcv";
|
|
477
394
|
|
|
478
|
-
|
|
395
|
+
const browser = await Camoufox({ headless: true });
|
|
479
396
|
|
|
480
|
-
|
|
397
|
+
const ctxA = await browser.newContext();
|
|
398
|
+
const ctxB = await browser.newContext();
|
|
481
399
|
|
|
482
|
-
|
|
400
|
+
const pageA = await ctxA.newPage();
|
|
401
|
+
const pageB = await ctxB.newPage();
|
|
483
402
|
|
|
484
|
-
|
|
403
|
+
await pageA.goto("https://example.com");
|
|
404
|
+
await pageB.goto("https://example.com");
|
|
485
405
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
| 4 | 10% |
|
|
492
|
-
| 5 | 6% |
|
|
493
|
-
| 6 | 4% |
|
|
406
|
+
// localStorage set in A is invisible from B
|
|
407
|
+
await pageA.evaluate(() => localStorage.setItem("key", "secret-a"));
|
|
408
|
+
const leaked = await pageB.evaluate(() => localStorage.getItem("key"));
|
|
409
|
+
console.log(leaked); // null ✓
|
|
410
|
+
```
|
|
494
411
|
|
|
495
|
-
|
|
412
|
+
Tests are in `test/isolation.test.ts`.
|
|
496
413
|
|
|
497
|
-
|
|
414
|
+
---
|
|
498
415
|
|
|
499
|
-
|
|
416
|
+
## Behavioral Seeding
|
|
500
417
|
|
|
501
|
-
|
|
502
|
-
|---|---|
|
|
503
|
-
| macOS | 2.0 × 70%, 1.0 × 20%, 1.5 × 10% |
|
|
504
|
-
| Windows | 1.0 × 45%, 1.25 × 20%, 1.5 × 20%, 2.0 × 15% |
|
|
505
|
-
| Linux | 1.0 × 75%, 2.0 × 15%, 1.5 × 10% |
|
|
418
|
+
Beyond raw fingerprint properties, bexxcv seeds high-level behavioral signals that detectors flag as suspicious when missing or default:
|
|
506
419
|
|
|
507
|
-
|
|
420
|
+
| Property Group | What Gets Seeded | Realism Logic |
|
|
421
|
+
|---|---|---|
|
|
422
|
+
| **Battery** | `battery:level`, `charging`, `dischargingTime` | Desktop → full & discharging; Laptop/Mac → 20–95% with ~25% charging state |
|
|
423
|
+
| **Media devices** | `mediaDevices:micros/webcams/speakers` | OS-weighted pools: mics [0-2], cams [0-2], speakers [0-4] |
|
|
424
|
+
| **Speech voices** | `voices[]`, `blockIfNotDefined`, `fakeCompletion` | 2–10 voices matching locale language |
|
|
425
|
+
| **Do Not Track** | `navigator.doNotTrack` | ~20% of real users enable DNT |
|
|
426
|
+
| **GPC** | `navigator.globalPrivacyControl` | ~10% signal GPC |
|
|
427
|
+
| **Referrer policy** | Firefox pref `privacy.referrer_policy` | Same-Origin on cross-origin for non-headless |
|
|
428
|
+
| **Online/cookies** | `navigator.onLine`, `cookieEnabled` | Almost always online and cookies enabled |
|
|
508
429
|
|
|
509
|
-
|
|
510
|
-
- X: center offset ±20px random jitter, clamped to screen bounds
|
|
511
|
-
- Y: biased toward the upper 45% of usable height (real users don't center windows vertically)
|
|
430
|
+
These are applied automatically when the installed Camoufox build supports the corresponding properties. Run `npx bexxcv doctor` to see your build's supported properties.
|
|
512
431
|
|
|
513
432
|
---
|
|
514
433
|
|
|
515
|
-
##
|
|
434
|
+
## Persistent context
|
|
516
435
|
|
|
517
|
-
```
|
|
518
|
-
|
|
519
|
-
npx bexxcv remove # Remove Camoufox binary and GeoIP database
|
|
520
|
-
npx bexxcv version # Show installed version
|
|
521
|
-
npx bexxcv path # Print install directory
|
|
522
|
-
npx bexxcv test [url] # Open a test browser window
|
|
523
|
-
npx bexxcv server # Start a Playwright remote server
|
|
524
|
-
npx bexxcv doctor # Check the bundled WebGL data
|
|
525
|
-
```
|
|
436
|
+
```ts
|
|
437
|
+
import { bexxcv } from "bexxcv";
|
|
526
438
|
|
|
527
|
-
|
|
439
|
+
const context = await bexxcv({
|
|
440
|
+
user_data_dir: "./browser-profile",
|
|
441
|
+
headless: false,
|
|
442
|
+
});
|
|
528
443
|
|
|
529
|
-
|
|
444
|
+
const page = await context.newPage();
|
|
445
|
+
await page.goto("https://example.com");
|
|
446
|
+
await context.close();
|
|
447
|
+
```
|
|
530
448
|
|
|
531
|
-
|
|
532
|
-
|---|---|
|
|
533
|
-
| `BEXXCV_IMPIT_CACHE` | Max size of the IMPIT instance LRU cache. Default: `8` |
|
|
534
|
-
| `CAMOUFOX_INSTALL_DIR` | Override install directory for the Camoufox binary |
|
|
535
|
-
| `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` | Set to `1` to skip binary download and use what's already cached |
|
|
536
|
-
| `GITHUB_TOKEN` | GitHub API token for higher rate limits during `fetch` |
|
|
449
|
+
A persisted profile survives restarts. Note: sharing profiles across different OS fingerprints may leak inconsistencies.
|
|
537
450
|
|
|
538
451
|
---
|
|
539
452
|
|
|
540
|
-
##
|
|
453
|
+
## Scripting helpers
|
|
541
454
|
|
|
542
|
-
|
|
455
|
+
The `getPossiblePairs()`, `sampleGPUProfile()`, and `resolveUAOS()` functions are exported for advanced use cases:
|
|
543
456
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
```js
|
|
547
|
-
import { bexxcv } from "bexxcv";
|
|
548
|
-
```
|
|
457
|
+
```ts
|
|
458
|
+
import { getPossiblePairs, generateFingerprint, getRealisticFonts, resolveUAOS } from "bexxcv";
|
|
549
459
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
```
|
|
460
|
+
const pairs = await getPossiblePairs();
|
|
461
|
+
console.log(pairs.windows[0]); // { vendor: "...", renderer: "..." }
|
|
553
462
|
|
|
554
|
-
|
|
463
|
+
const gpu = sampleGPUProfile("linux");
|
|
464
|
+
console.log(gpu.vendor, gpu.renderer);
|
|
555
465
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
import { bexxcv, Camoufox, NewBrowser, launchOptions, VirtualDisplay } from "bexxcv";
|
|
559
|
-
import type { BexxcvOptions, LaunchOptions } from "bexxcv";
|
|
560
|
-
|
|
561
|
-
import { createHuman, attachTurnstile, attachUam, waitForUam } from "bexxcv";
|
|
562
|
-
import type { HumanOptions, TurnstileOptions, UamOptions, UamResult } from "bexxcv";
|
|
563
|
-
|
|
564
|
-
// Xvfb utilities
|
|
565
|
-
import { needsXvfb, startXvfb, withXvfb } from "bexxcv/xvfb";
|
|
566
|
-
|
|
567
|
-
// VirtualDisplay class
|
|
568
|
-
import { VirtualDisplay } from "bexxcv/virtdisplay";
|
|
569
|
-
|
|
570
|
-
// Exception classes
|
|
571
|
-
import {
|
|
572
|
-
CannotFindXvfb,
|
|
573
|
-
CannotExecuteXvfb,
|
|
574
|
-
VirtualDisplayNotSupported,
|
|
575
|
-
CamoufoxNotInstalled,
|
|
576
|
-
UnsupportedVersion,
|
|
577
|
-
// ... etc
|
|
578
|
-
} from "bexxcv/exceptions";
|
|
466
|
+
const fp = generateFingerprint([1280, 720], { operatingSystems: ["linux"] });
|
|
467
|
+
console.log(fp.screen.width, fp.audioSeed, fp.webglVendor);
|
|
579
468
|
```
|
|
580
469
|
|
|
581
470
|
---
|
|
582
471
|
|
|
583
|
-
##
|
|
472
|
+
## Troubleshooting
|
|
584
473
|
|
|
585
|
-
### `
|
|
474
|
+
### `UnknownProperty` — unsupported config key
|
|
586
475
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
476
|
+
Some fingerprint properties aren't supported by older Camoufox builds. Run `npx bexxcv doctor` to see which properties your installed build supports. Properties not in `properties.json` are skipped automatically when using the default fingerprint pipeline.
|
|
477
|
+
|
|
478
|
+
### `VirtualDisplayError` — Xvfb not found
|
|
479
|
+
|
|
480
|
+
Install Xvfb on your system:
|
|
590
481
|
|
|
591
|
-
**Fix:**
|
|
592
482
|
```bash
|
|
593
483
|
# Debian / Ubuntu
|
|
594
484
|
sudo apt-get update && sudo apt-get install -y xvfb
|
|
@@ -600,15 +490,8 @@ apk add xvfb-run
|
|
|
600
490
|
dnf install xorg-x11-server-Xvfb
|
|
601
491
|
```
|
|
602
492
|
|
|
603
|
-
---
|
|
604
|
-
|
|
605
493
|
### `CamoufoxNotInstalled` — binary missing
|
|
606
494
|
|
|
607
|
-
```
|
|
608
|
-
CamoufoxNotInstalled: Camoufox is not installed. Please run `bexxcv fetch` to install.
|
|
609
|
-
```
|
|
610
|
-
|
|
611
|
-
**Fix:**
|
|
612
495
|
```bash
|
|
613
496
|
npx bexxcv fetch
|
|
614
497
|
```
|
|
@@ -619,28 +502,14 @@ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
|
|
619
502
|
CAMOUFOX_INSTALL_DIR=/path/to/your/binary
|
|
620
503
|
```
|
|
621
504
|
|
|
622
|
-
---
|
|
623
|
-
|
|
624
505
|
### `UnsupportedVersion` — outdated binary
|
|
625
506
|
|
|
626
|
-
```
|
|
627
|
-
UnsupportedVersion: Camoufox vX.Y.Z is not supported by this library.
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
**Fix:**
|
|
631
507
|
```bash
|
|
632
508
|
npx bexxcv fetch
|
|
633
509
|
```
|
|
634
510
|
|
|
635
|
-
---
|
|
636
|
-
|
|
637
511
|
### `CorruptedDownload` — checksum mismatch
|
|
638
512
|
|
|
639
|
-
```
|
|
640
|
-
CorruptedDownload: Checksum mismatch for Camoufox vX.Y.Z
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
**Fix:**
|
|
644
513
|
```bash
|
|
645
514
|
npx bexxcv remove
|
|
646
515
|
npx bexxcv fetch
|
|
@@ -649,8 +518,6 @@ rm -rf ~/.cache/camoufox
|
|
|
649
518
|
npx bexxcv fetch
|
|
650
519
|
```
|
|
651
520
|
|
|
652
|
-
---
|
|
653
|
-
|
|
654
521
|
### `UnsupportedArchitecture` — platform not supported
|
|
655
522
|
|
|
656
523
|
Supported matrix:
|
|
@@ -661,8 +528,6 @@ Supported matrix:
|
|
|
661
528
|
| macOS | `x86_64`, `arm64` |
|
|
662
529
|
| Windows | `x86_64`, `i686` |
|
|
663
530
|
|
|
664
|
-
---
|
|
665
|
-
|
|
666
531
|
### `MissingRelease` — GitHub rate limit or network issue
|
|
667
532
|
|
|
668
533
|
**Fix — add a GitHub token:**
|
|
@@ -672,14 +537,10 @@ GITHUB_TOKEN=ghp_your_token npx bexxcv fetch
|
|
|
672
537
|
|
|
673
538
|
Unauthenticated GitHub API is limited to 60 requests/hour per IP.
|
|
674
539
|
|
|
675
|
-
---
|
|
676
|
-
|
|
677
540
|
### `WebGL database not found or empty`
|
|
678
541
|
|
|
679
542
|
The package ships `webgl_data.db` inside `dist/data-files`. If you see this error while developing bexxcv itself, place a valid `webgl_data.db` in `src/data-files` and run `pnpm build` again.
|
|
680
543
|
|
|
681
|
-
---
|
|
682
|
-
|
|
683
544
|
### `playwright-core` version mismatch
|
|
684
545
|
|
|
685
546
|
bexxcv requires `playwright-core < 1.63.0`.
|
|
@@ -689,8 +550,6 @@ bexxcv requires `playwright-core < 1.63.0`.
|
|
|
689
550
|
npm install playwright-core@1.62.1
|
|
690
551
|
```
|
|
691
552
|
|
|
692
|
-
---
|
|
693
|
-
|
|
694
553
|
### Node.js version too old
|
|
695
554
|
|
|
696
555
|
bexxcv requires Node.js >= 22.
|
|
@@ -701,8 +560,6 @@ node --version
|
|
|
701
560
|
nvm install 22 && nvm use 22
|
|
702
561
|
```
|
|
703
562
|
|
|
704
|
-
---
|
|
705
|
-
|
|
706
563
|
### `InvalidProxy` — proxy format wrong
|
|
707
564
|
|
|
708
565
|
Proxy must be `protocol://[user:password@]host:port`:
|
|
@@ -713,8 +570,6 @@ await bexxcv({
|
|
|
713
570
|
});
|
|
714
571
|
```
|
|
715
572
|
|
|
716
|
-
---
|
|
717
|
-
|
|
718
573
|
### `NonFirefoxFingerprint` — wrong browser fingerprint
|
|
719
574
|
|
|
720
575
|
You passed a fingerprint generated for Chrome or Safari. bexxcv only accepts Firefox fingerprints.
|