* coherence: keep the display when repairing the ratio
fpgen records some ratios with a browser zoom folded in (1.0909 for
110%), which shrank every CSS size by the zoom. The repair moved the
ratio to the nearest display mode but kept the shrunken sizes, so an
identity drawn from a 1920x1080 monitor claimed a 1760x990 one at
100%. The browser renders at the claimed ratio on the real display,
so a fullscreen window measured 1920x1080 against screen.width 1760
(measured on WSLg). Rescale the CSS geometry with the ratio so the
screen is still the display it was recorded on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* coherence: a caller's screen is never rescaled
The ratio repair's rescale treated the screen and window sizes as keys
it repairs, so a caller who set them blocked the whole repair: a
1.0909 ratio drawn beside a caller's screen stayed unrepaired, and a
caller's own ratio was reported as screen.width, screen.height and
window.devicePixelRatio instead of the one key that is incoherent.
Rules now name the keys they only adjust; a caller who set any of
them keeps all of them, and the repair runs or is blocked on its own
keys alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* launch: a zoomed fpgen ratio claims its display
fpgen.yml leaves devicePixelRatio unmapped, so a drawn ratio with a
browser zoom folded in (1.0909 for 110%) left the screen at the
zoomed CSS sizes while the page reported the rendering scale: a
1920x1080 monitor was claimed as a 1760x990 one at 1, and a
fullscreen window on the real display measured 1920x1080 against
screen.width 1760 (measured on WSLg). The coherence rescale
never saw the ratio. A drawn ratio no display mode offers now goes
through that repair at launch, before the display clamp and the
available area are derived from the screen; real scales stay
unmapped as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* launch: a zoomed ratio follows the caller's scale
The zoom repair moved a zoom-folded fpgen ratio to the nearest display
step even when the caller set layout.css.devPixelsPerPx. The page then
rendered at the caller's scale but reported the step: on Windows with
the pref at 1 and 1.818 drawn, devicePixelRatio 1.75 while
matchMedia('(resolution: 1dppx)') matched, a pairing no Firefox has.
font-fallback-windows.py, which pins 1, failed on such draws. The
repair now targets the caller's scale, rescaling the geometry to it,
in both launchers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* driven-wheel-notches: expect a half-pixel line at devicePixelRatio 2
With the zoomed ratio repaired, a macOS identity can land on a ratio
of 2, where the scroller's line height is 29 device px = 14.5 CSS px.
Stock scrolls that fraction and rounds it only in the legacy events
(EventStateManager: CSSIntSize::FromAppUnitsRounded, "We don't deal
with fractional amount in legacy event"), so the guard expected 15 per
line from MozMousePixelScroll and failed on 14.5. It now compares the
scroll with the measured line height and checks the legacy events
carry it rounded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: coffeegrind123 <bsutherland747@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jake Writer <jake_writer@jobharvest.com>
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>
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>