mirror of
https://github.com/daijro/camoufox.git
synced 2026-11-19 00:07:28 +00:00
Three behaviours a page could detect, changed in one breaking release:
- **Animations run on stock timing.** no-css-animations.patch finished every
finite animation at once by default, and any page could read it:
`el.animate(frames, 1000).effect.getComputedTiming().duration` was 0, and a
500ms transition reported 0. Measured on v152.0.4-beta.31. The speedup is
now an opt-in, `instantAnimations: True`, which raises a LeakWarning.
disableInstantAnimations is gone.
- **speak() on a spoofed voice works like a real voice.** It fired `error`
after 3ms unless voices:fakeCompletion was set, and then start and end in
the same tick. It now starts and ends after the text's duration at ~150
words per minute. Both voices:fakeCompletion keys are gone, and so is a
debug line printed to stderr on every call.
- **Keys removed:**
- battery:* and window.scrollMinX/Y: Firefox keeps getBattery() and
scrollMin* chrome-only, so no page could read them.
- window.scrollMaxX/Y, screen.pageXOffset/pageYOffset,
window.history.length and document.body.client*: each pinned a live value
to a constant, so scrolling, navigating or re-laying out never changed it.
fpgen.yml mapped pageYOffset, so about 15% of identities froze
window.scrollY at a non-zero value.
- The body keys' role as an undocumented alias for window.innerWidth/Height
in browser-init and in the launcher.
- MaskConfig::GetInt32Rect, which only the body keys used.
New guards, both of which fail on v152.0.4-beta.31:
tests/patches/animation-timing.py and tests/patches/spoofed-voice-speaks.py.
The decisions are recorded as animations-run-on-stock-timing and
spoofed-voices-speak. Every patch applies cleanly to a fresh tree, and the
result builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
68 lines
3.0 KiB
YAML
68 lines
3.0 KiB
YAML
# Mappings of fpgen fingerprints to Camoufox config properties.
|
|
#
|
|
# fpgen (scrapfly/fingerprint-generator) replaced BrowserForge/Apify as the
|
|
# generator. The field set below is the one BrowserForge used to supply -- the
|
|
# rest of what fpgen carries (fonts, voices, WebGL parameters, system styles,
|
|
# permissions, RTC capabilities, audio) is NOT mapped here yet; Camoufox still
|
|
# draws those from its own catalogues. Wiring those through is the follow-up.
|
|
#
|
|
# Shape differences from browserforge.yml:
|
|
# - window geometry is its own `window` node, not part of `screen`
|
|
# - header values are lists
|
|
# - there is no extraProperties.globalPrivacyControl; GPC is a pref Camoufox
|
|
# owns (see utils.launch_options), so nothing maps to it
|
|
# - doNotTrack is deliberately NOT mapped: Camoufox sets DNT from its own
|
|
# config, and a drawn value is stripped unless the caller asked for one
|
|
|
|
navigator:
|
|
# fpgen's UAs trail the current release; the version is rewritten to the
|
|
# Camoufox Firefox version in _cast_to_properties.
|
|
userAgent: navigator.userAgent
|
|
appVersion: navigator.appVersion
|
|
oscpu: navigator.oscpu
|
|
platform: navigator.platform
|
|
hardwareConcurrency: navigator.hardwareConcurrency
|
|
# Never override productSub (#105)
|
|
# deviceMemory is not in Firefox, and fpgen reports the string "undefined"
|
|
# Locale is handled separately (locale:*)
|
|
maxTouchPoints: navigator.maxTouchPoints
|
|
|
|
screen:
|
|
availLeft: screen.availLeft
|
|
availTop: screen.availTop
|
|
availWidth: screen.availWidth
|
|
availHeight: screen.availHeight
|
|
height: screen.height
|
|
width: screen.width
|
|
colorDepth: screen.colorDepth
|
|
pixelDepth: screen.pixelDepth
|
|
|
|
window:
|
|
outerHeight: window.outerHeight
|
|
outerWidth: window.outerWidth
|
|
# innerWidth/innerHeight are deliberately NOT mapped.
|
|
#
|
|
# Spoofing them deadlocks Playwright: setViewportSize resizes the window and
|
|
# then waits for the page to report the size it asked for, and a spoofed
|
|
# innerWidth/innerHeight never changes, so the wait never ends. Camoufox
|
|
# already defaults to no_viewport for this reason (#666); this is the same
|
|
# trap reached through an explicit set_viewport_size() call.
|
|
#
|
|
# BrowserForge hid it by accident -- its Firefox samples carry innerWidth and
|
|
# innerHeight as 0, and _cast_to_properties skips falsy values, so these were
|
|
# never spoofed there either. fpgen reports the real numbers, which turned an
|
|
# unmapped field into a hang (tests/patches/humanize-edge-deadlock.py, which
|
|
# calls set_viewport_size, timed out at 600s in CI).
|
|
#
|
|
# Leaving them real is also the more coherent answer: the content area a page
|
|
# measures is then the one it actually has, which is what makes input at the
|
|
# bottom edge land (see BROWSER_CHROME_HEIGHT in coherence.py).
|
|
screenX: window.screenX
|
|
screenY: window.screenY
|
|
# devicePixelRatio is not mapped: any value but 1 is a spoofing tell unless
|
|
# the whole geometry is scaled with it.
|
|
|
|
headers:
|
|
# accept-language is redundant with locale:*, user-agent with navigator.userAgent
|
|
accept-encoding: headers.Accept-Encoding
|