Commit Graph
3 Commits
Author SHA1 Message Date
Jake WriterandClaude Opus 5.5 91cd2c34c1 Keep the caller's config values, and warn when they are incoherent (#969)
* Keep the caller's config values, and warn when they are incoherent

coherence.py repaired a config the caller wrote just as it repairs a drawn
one, and did it silently: an Apple Silicon identity passed with colorDepth 24
launched with 30, and a macOS devicePixelRatio of 1.5 with 1, while the caller
kept recording the values it had passed (#956).

A key the caller set is now never changed. coherence.apply() and
drop_incoherent_source_values() take the caller's keys; a repair that would
change one of them is skipped, and the violation comes back naming the keys
it kept. The launcher turns each into a LeakWarning that says what the value
contradicts and that a page can tell. i_know_what_im_doing does not silence
it. A repair that only touches other keys still runs, so a caller's
innerHeight still gets a window tall enough to hold it. pixelDepth is its own
rule now, so it follows whichever colorDepth stands.

Drawn values are still repaired, and every macOS identity now gets
colorDepth 30, Intel included. Firefox reports 30 on an M4 Mac mini and an M1
Pro MacBook. Every Apple Silicon preset reports 30, and so does every Intel
Mac preset but one in each file. Those two 24-bit rows are dropped by
clean-fingerprint-data.py.

Both launchers. The identity golden now also runs apply/drop with a random
set of kept keys, so the TS port is checked against pythonlib for that path.
The new tests fail on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* getter-cost-parity: stop timing getters Camoufox forwards to stock

innerWidth, innerHeight and outerWidth are read straight from stock's
code (fingerprint-injection.patch, #963), so the guard compared the same
code built twice. On one runner stock's outerWidth took 4.06x the
control against ~2.3x everywhere else, and Camoufox's usual 2.00x
crossed the FASTER bound (run 41123862536).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 15:46:38 +00: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 Writer 658806eb23 chore: major code cleanup/refactor 2026-10-06 19:10:22 -06:00