Files
archived-camoufox/pythonlib/camoufox
Ruben Vereecken 0830d36e47 Add config_overrides to generate_context_fingerprint(), fix font spacing disable (#601)
* Add system-ui font spoofing patch

GetSystemUIFontFamilies() now reads navigator.platform from MaskConfig
and returns the appropriate system font (Helvetica for macOS, Segoe UI
for Windows) before falling through to LookAndFeel::GetFont. Fixes the
CreepJS headless.systemFonts "Sans:Linux" leak when spoofing macOS from
Linux.

* Add patch verification test for system-ui font spoofing

Tests macOS and Windows presets: launches Camoufox with a fingerprint,
measures canvas text width with unquoted system-ui, asserts it matches
the expected system font (Helvetica / Segoe UI).

* Rename test to match patch naming convention

tests/patches/ files should mirror patch names, not use dated prefixes.

* Add config_overrides param to generate_context_fingerprint()

There was no clean way to override config values (like disabling font
spacing perturbation with fonts:spacing_seed=0) because init_script is
rendered inside generate_context_fingerprint() — by the time the caller
gets the config dict back, the init_script string is already baked.

config_overrides is applied after all config building (preset/seeds/
timezone/locale) but before init_script rendering, giving callers a
clean override point without touching the preset (which represents
real device data, not perturbation config).

The longer-term fix is separating config building from init_script
rendering so callers can modify config and re-render. config_overrides
is the minimal API addition that unblocks the use case without that
refactor.

* Rename test to match patch naming convention
2026-05-08 19:04:14 -04:00
..
2026-03-07 02:21:15 -06:00
2026-03-07 02:21:15 -06:00
2025-03-21 14:59:04 +01:00
2024-12-17 17:58:18 +00:00
2026-03-07 02:21:15 -06:00
2024-12-17 17:57:50 +00:00