Commit Graph
13 Commits
Author SHA1 Message Date
Jake WriterandClaude Opus 5.5 4559d018dc Date fpgen's model within signed 32-bit time, so read-only Lambda launches work (#856)
The pinned model files were dated 2100-01-01 so fpgen's five-week refresh
never replaces them. AWS Lambda keeps file times as signed 32-bit seconds and
reads that date back as 1963, so every launch tried to re-date the files,
Lambda's read-only filesystem raised EROFS, and the launch failed. Had the
error been ignored, fpgen would have seen a 1963 file as stale and fetched
its own model over the pin.

The files are now dated 2038-01-01, which a 32-bit filesystem stores as is.
A file that cannot be re-dated for any reason, not only a permission error,
is also left alone while fpgen still considers it current, so a read-only
image built with the earlier date keeps working. A stale file that cannot be
re-dated still fails the launch.

Fixes #854.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:27:42 +00:00
Jake WriterandClaude Opus 5.5 dac0b37117 Read the baseline-protection taskbar heights and touch points from launcher-constants.json
Both launchers hard-coded Firefox 156's GetSpoofedScreenAvailSize offsets
(48 Windows, 76 macOS, 0 Linux) and the collapsed touch-point count. They now
read them from the shared constants file, as the other values both launchers
use already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:02 -06:00
Jake WriterandClaude Opus 5.5 0bb4f14b74 Keep the caller's launch inputs unchanged, and claim the avail screen and touch points baseline protection reports
launch_options/launchOptions filled the caller's config, prefs, args and
addons in place. A config reused for a second launch then carried the first
identity's webGl:vendor in, which read as a GPU the caller named: the second
launch covered its canvas while claiming the host's GPU. The TypeScript
end-to-end test caught it through its Python probe, which calls
launch_options before Camoufox with the same kwargs. Both launchers now work
on copies.

Firefox's baseline fingerprinting protection reports the available screen as
the screen less a fixed taskbar for the claimed OS (48px Windows, 76px macOS,
none on Linux) and collapses more than one touch point to 5, and the browser
applies that to the spoofed values. The launchers still claimed fpgen's
recorded avail rect, adjusted by fix_screen_no_taskbar, so a Linux identity's
config said availHeight 1053 while the page read 1080. follow_baseline_protection
/ followBaselineProtection replaces it and claims what the browser reports.

The end-to-end test now compares a covered canvas by being covered (its
readback is random on every read, so its size was too), launches the
NewContext scenario with canvas_noise, since an uncovered browser binds its
contexts to the host, and checks a headful launch against its own config,
because Xvfb can render on another device than headless.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:02 -06:00
Jake WriterandClaude Opus 5.5 0c98d2b734 Look up each spoof by the document's own context, and make the OS, popups and startup prefs per-context or loud
- One helper, RoverfoxStorageManager::UserContextId(), reads the user
  context from a principal, node or window. Every per-context lookup used
  the browsing context instead, which a document from
  createHTMLDocument() or DOMParser does not have, so a canvas there read
  context 0, which held whichever context set its values last: a page
  could see two GPUs (#839) or another context's font list. The setters
  no longer copy their values into context 0.
- UNMASKED_RENDERER_WEBGL and UNMASKED_VENDOR_WEBGL apply stock's
  fingerprinting-protection checks before the spoofed value, as RENDERER
  does, so the two never disagree.
- system-ui, the CSS2 system fonts and WebRTC's fabricated port use the
  context's own OS (NavigatorManager::GetSpoofedOS), not the launch's, so
  a macOS context of a Windows launch no longer resolves Segoe UI.
- CamoufoxWindow sizes only windows the driver opens; a page's popup keeps
  the size it asked for.
- camoufox.cfg applies CAMOU_PREFS through the default branch and quits
  with the reason on stderr when a pref cannot be applied, instead of
  starting without it.
- Delete commented-out prefs; shorten the setter-seal comments into a
  tribal rule; mark the unread navigator.buildID key removed.
- Refresh five patches that only applied with fuzz; the patched tree is
  byte-identical.
- Guards: webgl-renderer-pair covers data and DOMParser documents, two
  contexts and the unmasked vendor; new context-os-system-font and
  popup-window-size; startup-prefs covers the loader's failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:02 -06:00
Jake WriterandClaude Opus 5.5 ee9e3185f2 Fix CI review findings: deterministic proxy skips, shipped fontconfig as a browser input, doc links and paths
- The skiplist audit runs each entry in its own pytest process without
  upstream's reruns. test_browsercontext_proxy.py shares one browser, and
  HTTPS-First's per-host exception means only its first proxied navigation
  fails, so every navigating test there is listed and each is audited from
  a fresh browser. Record HTTPS-First staying on in ci/tribal-rules.yml.
- Drop the test_worker locale entry and its overlay test: upstream v1.62.0
  asserts the same ru-RU behaviour, so the entry passed the audit.
- browser/bundle/fontconfig ships in every package, so it is now a browser
  input (BROWSER_DIRS and the resolve grep), with a test that every
  --includes path is one.
- Revert the binary-config-keys allowance: a driver-only PR tests the release
  paired by source digest, which covers properties.json.
- Playwright guards use helpers.resolve_binary and a new helpers.launch_kwargs
  instead of per-file copies.
- Docs: absolute links in the PyPI/npm READMEs, a Python development section,
  repository-root markers in the patch guide, Playwright porting merged into
  it, fpgen-js, the moved fpgen pin and font-constant files, and the
  canvas-noise and browser/executable_path launcher changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:02 -06:00
Jake WriterandClaude Opus 5.5 12b81fdada Read the font bundle only through its group layout, and run a lost test
gen-fonts-json.py and verify-fonts.py read the groups listed in groups.json
through _font_bundle.read_groups(). Neither falls back to the per-OS layout
the group layout replaced any more: a bundle without groups.json is an error.

test_salt_of_equal_objects_is_equal had slipped inside another test's body
and never ran; it is back in TestPinnedIdentityIsStable and passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:01 -06:00
Jake WriterandClaude Opus 5.5 6c3850f60a Remove dead and duplicated code across the launchers, scripts and CI
Values both launchers hard-coded (marker fonts, the Windows 11 fonts, the
Apple Silicon and Intel Mac core and panel tables, plausible DPR and core
counts, the macOS MacinTalk/Eloquence voices, the cache prefs) now live in
python/src/camoufox/launcher-constants.json, which the TypeScript package
ships as a data file. gen-fonts-json.py and verify-fonts.py read the same
file, so the drifted PingFang marker copy is gone (fonts.json regenerates
byte-identical) and verify-fonts no longer ast-parses fingerprints.py.

- Drop the duplicate fpgen model pin under browser/scripts/data; the TS
  test checks the fpgen package's MODEL_PIN against the Python copy.
- Move pin-fpgen-model.py and clean-fingerprint-data.py to python/scripts.
- Delete the font licence report (font-metrics/licences.py and its saved
  output, open-fonts.txt): the bundle ships as built, so the report checks
  nothing.
- Delete unreferenced files: cleanfonts.sh, python/examples,
  typescript/renovate.json.
- Delete dead code: classify_installs, remove_mmdb, write_upstream_sh,
  bump_release, unused test constants and fixture helpers, the
  _virtual_display attribute writes, package.py's pre-groups font copy (a
  missing groups.json now fails).
- Share require_bundle, zip_entries, gh_headers and parse_shard instead of
  keeping copies; fold GitHubDownloader into CamoufoxFetcher in both
  launchers.
- TS raises ValueError where Python does, and `camoufox version` prints the
  fpgen package version as Python does.
- Python tests get src/ from pytest's pythonpath instead of sys.path
  inserts; skips that hid untested paths now assert or test the behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:38:55 -06:00
Jake WriterandClaude Opus 5.5 5c1fd578ad Read a build's version from its own bundle, refuse browser= with a binary, and cover the canvas whenever the GPU is not the host's
- A named executable's application.ini is found beside it, or in
  Contents/Resources of a macOS app bundle (pkgman.build_file / buildFile),
  and a named executable without one raises instead of borrowing the paired
  build's version. browser= on macOS no longer raises CamoufoxNotInstalled
  or claims the wrong Firefox major.
- browser= together with executable_path or CAMOUFOX_EXECUTABLE_PATH raises
  ValueError instead of silently dropping browser=.
- One function per launcher (plan_rendering / planRendering) decides whether
  the identity claims the host's GPU or the canvas is covered, for the launch
  and for the host identity its contexts keep. A GPU named by webgl_config or
  a preset, or a host GPU fpgen never recorded, now covers the canvas by
  default, and such a browser binds no context to the host.
- setWebgpu keeps a caller pref set to null, as Python's setdefault does.
- stock-gpu-parity verifies SHA256SUMS.asc against Mozilla's release key and
  uses camoufox.webgl.recorded_devices instead of private helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:38:46 -06:00
Jake Writer d9fa53e96b fix: ensuring documentation matches behavior for pinning 2026-10-08 19:59:50 -06:00
Jake WriterandClaude Opus 5.5 159aebedac Claim the host's GPU on its own OS, cover canvas and WebGPU on another, and follow Firefox 156 for browser-owned GPU values
Canvas, WebGL and WebGPU output come from the real OS, driver and GPU. On the
host's OS the identity now claims the GPU Firefox actually renders with; on
another OS canvas and WebGL readback use privacy.resistFingerprinting's canvas
placeholder (canvas_noise, on by default only for another OS, with a LeakWarning).

WebGPU follows the claimed device: navigator.gpu only where Firefox exposes it
(Windows, Apple Silicon), and the host's adapter only when the identity claims
the host's hardware GPU. Otherwise gfx.blacklist.webgpu marks the device
blocked, so requestAdapter() resolves to null as it does for real users on a
blocked or software GPU. The pref is read at startup, so it goes through
CAMOU_PREFS.

Spoofed avail-screen and touch values now pass through stock baseline
fingerprinting protection for the claimed platform (screen-spoofing,
touchscreen-fingerprint-spoofing).

fpgen's records are mostly Firefox 146, and two WebGL values are decided by
the browser rather than the device: Windows extension lists now include
EXT_depth_clamp (ANGLE's D3D11 backend reports it on every feature level in
156), and WebGL1's ALIASED_LINE_WIDTH_RANGE takes the device's WebGL2 value
(Firefox 156 no longer forces a compatibility profile for WebGL1 on Linux).

A new parity guard, stock-gpu-parity, compares stock Firefox at the build's
version, stock Firefox at the release fpgen recorded, and Camoufox claiming the
host's GPU, and fails when Camoufox differs from stock on a value the two stock
releases disagree on. Decisions are recorded in ci/tribal-rules.yml
(cross-os-canvas-is-the-rfp-placeholder, webgpu-follows-the-claimed-device,
webgl-browser-owned-values-follow-firefox).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:08:30 -06:00
Jake Writer a4a9286452 fix: minor leak fixes, patch cleanup, webgpu windows/mac leak fix 2026-10-07 15:32:24 -06:00
Jake Writer 914b575e8f feat: working on cleaning up and fixing patches 2026-10-06 20:47:49 -06:00
Jake Writer 658806eb23 chore: major code cleanup/refactor 2026-10-06 19:10:22 -06:00