Back to Camoufox

Camoufox Build Tester

build-tester/README.md

146-hardware3.4 KB
Original Source

Camoufox Build Tester

Tests a raw Camoufox binary (Firefox) directly against the same antibot-detection checks used in the service tests. Use this to validate a binary before packaging/releasing — it bypasses the Python package entirely.

Prerequisites

  • Python 3.9+
  • Node.js (for building the TypeScript checks bundle via esbuild, first run only)

Setup

bash
# Install npm deps (once — needed to build the checks bundle)
npm install

# Install Python deps
pip install -r requirements.txt

Usage

bash
python scripts/run_tests.py <binary_path> [options]

Example:

bash
python scripts/run_tests.py /path/to/camoufox-bin/camoufox

Options

  binary_path           Path to the Camoufox (Firefox) binary
  --profile-count N     Number of profiles to test (1-8, default: 8)
  --secret KEY          HMAC signing key for certificate
  --save-cert PATH      Save certificate text to a file
  --no-cert             Skip certificate generation

What It Tests

8 profiles total, run in two phases:

Per-context phase (6 profiles) — 3 macOS + 3 Linux profiles open simultaneously in a single browser instance, each with an isolated fingerprint injected via addInitScript. Tests that fingerprints are unique and don't leak between contexts.

Global phase (2 profiles) — 1 macOS + 1 Linux profile launched with fingerprint config passed via the CAMOU_CONFIG environment variable. Tests that browser-level fingerprint injection works correctly.

Each profile is scored across:

CategoryWhat it checks
Automation DetectionPlaywright/CDP artefacts
JS EngineV8 vs SpiderMonkey signals
Lie DetectionInconsistent property overrides
Firefox APIsFirefox-specific API presence
Cross-SignalConsistency across navigator, screen, etc.
CSS FingerprintCSS rendering fingerprint
Canvas NoiseCanvas hash uniqueness and stability
WebGL RenderWebGL rendering hash
Audio IntegrityAudioContext fingerprint
Font PlatformOS-consistent font availability
Speech VoicesVoice list matches declared OS
WebRTCIP spoofing (test IP injected)
StabilityFingerprint stable over time
Headless DetectionNo headless mode signals
Match ResultsInjected values actually appear in page

How It Differs from the Service Tests

Build TesterService Tests
Entry pointRaw binary pathpip install camoufox
Fingerprint injectionManual (generate_context_fingerprint + init script)Via AsyncNewContext API
Global modeYes (CAMOU_CONFIG env var)No
Match validationYes (checks injected values match page)No
Proxy supportNoYes
Profile count8 (6 per-context + 2 global)6 (per-context only)

The Checks Bundle

scripts/checks-bundle.js is a compiled artifact built from the TypeScript sources in src/lib/checks/. It is built automatically on first run. To force a rebuild, delete it:

bash
rm scripts/checks-bundle.js
python scripts/run_tests.py <binary_path>

Source files:

  • src/lib/checks/index.ts — entry point
  • src/lib/checks/core.ts — automation, JS engine, lie detection, etc.
  • src/lib/checks/extended.ts — canvas, WebGL, fonts, audio, etc.
  • src/lib/checks/workers.ts — worker thread consistency
  • src/lib/checks/collectors.ts — fingerprint data collectors (hashes, WebRTC, stability)