BrowserForge picks navigator/screen; the GPU is drawn separately from
webgl_data.db weighted only by OS. Nothing ties the two together, so the
synthetic path emits pairs no real machine ships -- a discrete desktop GPU
behind a 1024x600 panel. Consistency checks (Pixelscan, Fingerprint.com) read
that as masking even though every individual value is plausible on its own.
Builds on @dyiapanis's #730, which identified the problem and the GPU-class
thresholds, with three changes:
* Constrain the GPU to the screen rather than the screen to the GPU.
sample_webgl_for_screen does rejection sampling, so the GPU keeps
webgl_data.db's real OS-weighted distribution and the geometry -- already
reconciled against the real display and the window box by
clamp_screen_to_display / fix_screen_no_taskbar / clamp_window_dimensions
/ clamp_window_position -- is left alone.
* Where no coherent GPU exists at all (BrowserForge still carries
netbook-era geometry, and nothing in the pool drives a sub-1366x768
panel), raise_screen_to_gpu_floor lifts the screen instead. It measures
the screen-to-avail gap BEFORE mutating -- #730 computed it after
overwriting screen.height, which turned a 1024x600 -> 1080 bump into a
520px "taskbar", a fresh impossible-geometry tell -- and it runs BEFORE
clamp_screen_to_display so a genuinely small monitor still wins and a
headful window cannot be pushed back off its own display (#499).
* No Apple-M Retina floor. Apple silicon also ships in the Mac mini and Mac
Studio, which drive whatever external monitor is attached, so pinning it
to 2560x1600 would reject real hardware and shrink the pool for nothing.
Measured over 300 synthetic fingerprints, incoherent GPU/screen pairs fall
from 54.3% to 0%, with avail <= screen and availHeight < height holding in
every trial. The screen floor is a no-op for the Linux and Windows pools
(0/400 draws below it) and fires on 3.5% of macOS draws, so the entropy cost
is confined to the implausible tail it exists to remove.
Co-authored-by: D Yiapanis <d@yiapanis.co>
Firefox registers the host's speech-dispatcher / SAPI / NSSpeech voices
unless something stops it, and nsSynthVoiceRegistry only stopped it when the
explicit `voices:blockIfNotDefined` flag was set. Nothing set that flag, so
the host was suppressed only as a side effect of a non-empty spoofed list --
and the Python layer built that list inside a bare `except Exception: pass`.
Any path that left the list empty or unset therefore fell through to the host
backend. On a stock Linux box that exposes 14805 espeak-ng voices to the page
under a fingerprint claiming macOS or Windows, which both leaks the real host
OS and contradicts the rest of the profile. Reproduced on 152.0.4-beta.29:
config voices exposed
generation raises 14805 (all host speechd)
{"voices": []} 14805 (all host speechd)
valid list 115 (correct)
Three changes, so the failure is closed at both layers:
* nsSynthVoiceRegistry::AddVoice now also blocks when MaskConfig carries a
`voices` array at all -- including an empty one, or one whose entries were
all rejected as malformed. An empty spoofed list must mean "no voices",
never "all of the host's". With no `voices` key the browser still behaves
like stock Firefox, so a bare binary is unaffected.
* launch_options pins `voices:blockIfNotDefined` (via set_into, so an
explicit caller value still wins) and degrades a generation failure to an
empty list rather than leaving the key unset. It also passes the spoofed
navigator.language through, so the default voice matches the locale.
* validate_voices rejects the shapes MaskConfig::MVoices() silently drops --
bare "Name:lang:type" strings and half-filled objects -- before launch
instead of letting them degrade into a host-voice leak.
Both failure paths now expose 0 voices; the normal path still exposes 115.
Conflict: pythonlib/camoufox/utils.py — both sides fixed the fontconfig
cache dir independently (#654 here, #712 upstream). The two spellings
resolve to the same path, since pkgman's INSTALL_DIR is
platformdirs.user_cache_dir("camoufox"). Kept INSTALL_DIR so the module
has one name for that directory, dropped the now-unused platformdirs
import, and kept the comment explaining why the dir must sit outside the
read-only browser bundle.
_generate_fontconfig hardcoded ~/.cache/camoufox/fontconfig instead
of respecting XDG_CACHE_HOME. On systems where ~/.cache is read-only
(e.g. containerized environments), this causes OSError on browser launch.
Replaced os.path.join(os.path.expanduser('~'), '.cache', 'camoufox',
'fontconfig') with os.path.join(platformdirs.user_cache_dir('camoufox'),
'fontconfig'). platformdirs is already a declared dependency and
respects XDG_CACHE_HOME on Linux, ~/Library/Caches on macOS, and
%LOCALAPPDATA% on Windows.
Closes#654
PR #398 added `persistent_context` / `user_data_dir` to `launch_options()` and
emitted `_user_data_dir` in the result, on the assumption that Playwright's
`browserServerImpl` consumes it. It does not.
`launchServer()` spreads its options into `BrowserType.launch()`, which passes
`undefined` as the userDataDir and never reads `options._userDataDir` (only
`browser._userDataDirForTest` is ever assigned, after the fact). Verified
against the bundled playwright-core 1.53.1: launching a server with
`user_data_dir=/tmp/...` starts cleanly and leaves the directory empty.
Serving a persistent context is not merely unimplemented, it is outside
Playwright's server model: `launchPersistentContext` returns a BrowserContext
while `PlaywrightServer` only accepts a `preLaunchedBrowser`.
So keep #398's genuinely-correct `camel_case` fix -- it lets any underscore-
prefixed private option reach the driver -- and drop the two options that would
otherwise be accepted, validated, and silently ignored. `launch_server()` now
fails loudly and points at the in-process API instead.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
get_screen_cons() was gated on DISPLAY being set, which only ever happens on
Linux, so headful runs on Windows and macOS generated fingerprints with no
monitor bound at all.
Fixes#425
screeninfo makes the process per-monitor DPI aware, so it reports physical
pixels, while Firefox lays windows out in CSS pixels. At 150% Windows scaling a
1920x1080 panel is 1280x720 CSS px, so bounding the fingerprint by the physical
size lets the window open 1.5x larger than the screen.
Refs #425
headless='virtual' reaches launch_options as headless=False with
virtual_display set (async_api rewrites it), so the headful gate fired and
clamped the fingerprint to Xvfb's 1x1 stub. fix_screen_no_taskbar then drove
availHeight to -39 and validate_config rejected the launch outright.
get_screen_cons() bounds the generated fingerprint to the monitor, but
BrowserForge honours a Screen constraint only when its pool has a match:
FingerprintGenerator.partial_csp catches the filtering failure and deletes the
constraint unless strict=True. So a 1366x768 laptop routinely gets a 2560x1440
fingerprint with window.outerWidth 1920, and browser-init resizes the real
chrome window to it -- rendering past the edge of the monitor.
Re-apply the bound after generation instead of trusting BrowserForge with it,
and pull screenX/screenY back inside the shrunken screen.
Headful only. headless has no window to overflow, and headless='virtual' runs a
1x1 Xvfb whose "monitor" would otherwise shrink the fingerprint to 1x1.
Fixes#499
PR #678 made the fontconfig cache XDG-aware, but `get_path('fontconfig')`
resolves inside the versioned browser install directory
(.../browsers/official/<version>-<hash>/fontconfig/), which already holds the
bundled linux/ macos/ windows/ trees and is read-only in the common
"bake the browser into the image as root, run as non-root" deployment.
Use INSTALL_DIR / 'fontconfig' instead: still XDG-aware, but outside the
bundle. This is byte-identical to the pre-#678 path when XDG_CACHE_HOME is
unset, so existing caches are reused and no migration is needed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fixes the new_page() hang from #666, and restores the pythonlib/ + settings/
halves of #637-#647 that were dropped when those PRs were consolidated into #666
(that PR only carried patches/ + additions/, so these never actually landed).
## new_page() hangs when window.outer* is spoofed (#666)
The outer-size hijack in browser-init.patch pinned the chrome documentElement to
the spoofed size. That caps .browserStack, which caps the content viewport, so
the content window can never reach the size Juggler asks for in
updateViewportSize() -- and awaitViewportDimensions awaits exact equality with
no timeout, so it deadlocks rather than erroring. The second new_page() hung
forever and took the context with it.
The pin was never load-bearing: GetOuterWidth/GetOuterHeight already consult
MaskConfig unconditionally (fingerprint-injection.patch), so window.outerWidth is
spoofed in C++ regardless of the real chrome window size. Resizing is enough.
Measured on the official v152.0.4-beta.26 build (headless):
config before after
none pass pass
inner pass pass
outer HANG pass
both HANG pass (iw:360 ih:740 ow:360 oh:800 -- exact)
This corrects the diagnosis in #666, which blamed the inner+outer combination and
the `!(outerWidth || outerHeight)` guard. outer* ALONE is sufficient to hang, and
dropping inner* does not help, so that guard is not the culprit.
Also fixed driver-side: Playwright's implicit 1280x720 viewport is what asks for
the impossible size, so the driver now defaults to no_viewport when the config
spoofs any window dimension. That fixes the hang on already-released builds
without a rebuild. An explicit viewport=/no_viewport= from the caller wins.
## WebRTC ICE prefs (#538)
#666 merged the C++ half of the WebRTC fix but not the prefs, so the shipped
build still has no_host=true and none of the proxy_only prefs.
proxy_only_if_behind_proxy is the pref that actually stops the real-IP leak: it
prevents a UDP STUN request routing around a TCP proxy. no_host=false keeps the
stock two-candidate shape, which obfuscate_host_addresses makes leak-free.
## Also restored from the consolidation
- fix(proxy): dom.security.https_first rewrote http:// before the launch-arg
proxy filter saw it, breaking CONNECT-only proxies (#638).
- fix(stealth): speech-voice spoofing + stop leaking host voices (#646).
- fix(stealth): clamp inner <= outer <= avail <= screen; BrowserForge can emit
impossible geometries that leak as tells (#647).
Refs: https://github.com/daijro/camoufox/pull/666
Refs: https://github.com/daijro/camoufox/issues/538
* fix v150 patches
* screen related patch fixes
* fix juggler issues with 150
* Update grading.py
improved build tester scoring
* fix windows build for v150
- scripts/_mixin.py: switch moz_target from x86_64-pc-mingw32 (no longer
supported in FF150) to x86_64-pc-windows-msvc
- additions/juggler/screencast/HeadlessWindowCapturer.h: typedef pid_t
on XP_WIN; libwebrtc headers (video_capture.h, desktop_capturer.h)
reference pid_t which is POSIX-only
- patches/anti-font-fingerprinting.patch: include mozilla/dom/Document.h
in gfxTextRun.cpp; on Windows it is not transitively included so
doc->GetInnerWindow() failed with "incomplete type 'Document'"
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* make service test use local binary
* updated ff fingerprint versions
* Update README.md
---------
Co-authored-by: Ubuntu <ubuntu@ip-172-31-15-96.us-east-2.compute.internal>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When using Xvfb-backed virtual display, override Wayland env vars
(GDK_BACKEND, WAYLAND_DISPLAY, MOZ_ENABLE_WAYLAND) so Firefox/GTK
honors DISPLAY and reliably uses the X11 virtual screen.
closes#575
Without FONTCONFIG_FILE, fontconfig loads the system's /etc/fonts/fonts.conf
which includes system font directories. This means system fonts leak into the
rendering pipeline for fallback glyphs (emoji, CJK, etc.), even though the
font enumeration whitelist hides them from JavaScript. The result is
environment-dependent font metrics that differ between machines with different
system font packages installed.
Generate a runtime fontconfig at ~/.cache/camoufox/fontconfig/ that resolves
the bundled font directory absolutely (the bundled fonts.conf uses
prefix="cwd" relative paths which break under Playwright), and point
FONTCONFIG_FILE at it.
Allow callers to inject pre-resolved timezone/locale into the
fingerprint before init_script generation. When provided, these
take priority over preset data.
In launch_options(), use setdefault for geoip timezone/locale keys
so that values pre-set via generate_context_fingerprint() aren't
overwritten by geoip resolution.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* example files
* contributing guides
* simple service test
* run tests in sync
* update pr template
* pip updates
* Update README.md
* typo fixes
* undo pip package update lol
* upgraded service test
* undo injections
* test with proxies
* auto set timezone and proxy url
* delete checks bundle
* split up service tests
* split up build tests
* rename service tests to service tester
* Update CONTRIBUTING.md
* fix entry vs exit ip
* allow alpha versions
* fix patch issues on macos
* bidirectional patch
* Add note on experimental pip package
* feat: update timezone, geolocation, and locale spoofing patches
- timezone-spoofing.patch: per-context timezone via per-realm DateTimeInfo
- geolocation-spoofing.patch: CAMOU_CONFIG backwards compatibility for geolocation
- locale-spoofing.patch: add camoucfg LOCAL_INCLUDES
- anti-font-fingerprinting.patch: add RoverfoxStorageManager exports to moz.build
* feat: per-context audio fingerprinting and screen spoofing patches
- audio-fingerprint-manager.patch: per-context audio fingerprinting (all 6 API methods)
- screen-spoofing.patch: per-context screen dimensions with global MaskConfig fallback
- Disable webrtc-ip-spoofing.patch (will re-enable after fixing)
- Remove screen-hijacker.patch (superseded by screen-spoofing.patch)
* fix: add global MaskConfig hooks for navigator.platform, hardwareConcurrency, and timezone (#443)
Fixes issue where global CAMOU_CONFIG settings for navigator.platform,
navigator.hardwareConcurrency, and timezone were not applied in the main
window Navigator (only WorkerNavigator was patched via fingerprint-injection.patch).
* fix: run nsJSUtils::SetTimeZoneOverride() after SpiderMonkey has Initialized to prevent SIGSEGV
* Add fingerprint improvements for PR #3
- navigator-spoofing.patch: Global config fixes for platform/hardwareConcurrency/timezone
- timezone-spoofing.patch: Persistence across page navigation via SetNewDocument hook
- audio-fingerprint-manager.patch: Full 6-method coverage with self-destruct pattern
- screen-spoofing.patch: Per-context dimensions with self-destruct pattern
- webrtc-ip-spoofing.patch: Re-enabled with getStats() sanitization + comprehensive IPv6 regex
* fix: simplify userContextId to BrowsingContext + add per-context docs
* feat(navigator): Add per-context spoofing (platform, oscpu, hardwareConcurrency) with global fallback + docs update.
* fix(navigator): use 2-arg GetUint(key, value) for RoverfoxStorageManager
* fix(navigator): header line count build error
* fix(navigator): move NavigatorManager.cpp into SOURCES for leakage error
* fix(navigator): more line count build errors
* fix(navigator): include nsTHashMap and nsHashKeys.h before RoverfoxStorageManager
* feat(webgl): per-context spoofing patch
* fix(webgl): changed GetCanvasElement() to mCanvasElement() for firefox version
* fix(webgl): remove coupled self-destruct
* feat(canvas): per-context spoofing
* feat(font-list): per-context spoofing
* fix(font-list): use GetOwnerWindow() instead of GetOwner()
* feat(speech): per-context spoofing
* fix(speech): add /dom/base inside local_includes
* fix(speech): changed context to avoid conflicts
* feat(navigator): add WorkerNavigator hooks for per-context platform and hardwareConcurrency in workers
* feat(timezone): add per-context timezone override to workers
* fix(canvas): add OffscreenCanvas userContextId support and skip zero pixels in canvas noise
* fix(screen): hook nsMediaFeatures GetDeviceSize for per-context matchMedia device-width/height
* fix(webgl): add OffscreenCanvas userContextId fallback in WebGL GetUserContextId
* fix(canvas): make canvas noise use proper format for BGRA toDataURL path
* fix(canvas): line count fixes
* docs: updated hardware per-context documentation
* Final Per-Context Hardware Fingerprint Spoofing (#9)
* feat(navigator): Add per-context spoofing (platform, oscpu, hardwareConcurrency) with global fallback + docs update.
* fix(navigator): use 2-arg GetUint(key, value) for RoverfoxStorageManager
* fix(navigator): header line count build error
* fix(navigator): move NavigatorManager.cpp into SOURCES for leakage error
* fix(navigator): more line count build errors
* fix(navigator): include nsTHashMap and nsHashKeys.h before RoverfoxStorageManager
* feat(webgl): per-context spoofing patch
* fix(webgl): changed GetCanvasElement() to mCanvasElement() for firefox version
* fix(webgl): remove coupled self-destruct
* feat(canvas): per-context spoofing
* feat(font-list): per-context spoofing
* fix(font-list): use GetOwnerWindow() instead of GetOwner()
* feat(speech): per-context spoofing
* fix(speech): add /dom/base inside local_includes
* fix(speech): changed context to avoid conflicts
* feat(navigator): add WorkerNavigator hooks for per-context platform and hardwareConcurrency in workers
* feat(timezone): add per-context timezone override to workers
* fix(canvas): add OffscreenCanvas userContextId support and skip zero pixels in canvas noise
* fix(screen): hook nsMediaFeatures GetDeviceSize for per-context matchMedia device-width/height
* fix(webgl): add OffscreenCanvas userContextId fallback in WebGL GetUserContextId
* fix(canvas): make canvas noise use proper format for BGRA toDataURL path
* fix(canvas): line count fixes
* docs: updated hardware per-context documentation
* feat(screen): screen avail per context
* fix(font): align userContextId resolution to BrowsingContext
* fix(audio): align userContextId resolution to BrowsingContext
* Avoid macos caching (#11)
* the property to undefined before deleting
* undo webrtc undefined
* feat: userContextId added to WordCacheKey
* fix: hunk line counts for macos cache changes
* fix: add WorkerPrivate fallback in OffscreenCanvas
* fix(audio): transformation added to mSharedChannels path to ensure consistency
* fix(webgl): added WorkerPrivate to ucid
* fix(timezone): add ucid=0 fallback for worker timezone resolution
* fix(audio): move seed lookup outside window guard for all 6 hooks
* fix(canvas): add ucid=0 fallback and WorkerPrivate resolution for workers
* fix(navigator): add setNavigatorUserAgent and ucid=0 fallback and WorkerNavigator for UA spoofing fix
* fix(webgl): add ucid=0 fallback and WorkerPrivate resolution
* fix(webgl): decouple vendor/renderer self-destruct
* fix(navigator): add main-thread navigator.userAgent getter hook
* fix(navigator): add MaskConfig hook for navigator.appVersion in main window
* feat: Add Chakra Petch font for macOS to solidify detection on CreepJS
* fix(fontconfig): rename to match Go launcher, add TTC aliases and update .gitignore
* fix(navigator): oscpu missing MaskConfig global fallback
* feat: add real fingerprint presets (65 firefox profiles) - mainly to test with, more will come when tested.
* feat: use real fingerprint presets as default with BrowserForge as fallback
* feat: add audio:seed and canvas:seed to property schema and validation
* feat: add MaskConfig fallback to seed managers for cross-process worker consistency - don't need to disable fission
* fix(font): moved mUserContextId declaration before mRounding in WordCacheKey so init order matches
* fix(audio): line count correction
* fix(canvas): line count fix
* feat: add per-context fingerprinting API (NewContext/AsyncNewContext) + merge upstream
- fix seed range
- add oscpu derivation from platform, and timezone mapping in from_preset()
- new real fingerprints preset support
* feat: new presets + en-US only, stripped fonts/language, clamp DPR
* feat: random 30-78% font subset generation for NewBrowser and NewContext
* fix: add fission.autostart=true to camoufox.cfg - will be changing this soon with new update so processCount is not 1, so it will be undetectable
* fix: update macos fonts.conf rendering settings
* feat: cross-process fingerprint storage via Firefox Preferences API
Replace RoverfoxStorageManager's per-process static HashMap with Firefox's
built-in Preferences system. Values stored as CString prefs under
"roverfox.s." namespace, auto-synced to all content processes by Firefox.
Content processes can't set prefs directly (ENSURE_PARENT_PROCESS), so a
single IPDL message (RoverfoxStoragePut) routes writes through the parent.
Same public API — all 10 dependent patches require zero changes.
Removes dom.ipc.processCount=1 from camoufox.cfg. Firefox now uses
Playwright's default multi-process model (fresh process per page) with
fission enabled, while fingerprint values remain accessible everywhere.
* fix(cross-process): hunk headers and build fixes
* fix(storage): add local write-through cache to RoverfoxStorageManager
* fix(storage): add sync IPC read fallback for cross-process fingerprint propagation
* fix(storage): add NS_IsMainThread guard to sync IPC fallback - prevent crashes
* fix(storage): sync IPC + pref whitelist for cross-process fingerprint sync
* feat: full documentation update, speech voices generated per context and BrowserForge primary fingerprint generation method for global and per context.
* fix: Direct3D NVIDIA GTX 980 renderers incorrectly appearing on mac because of duplicates
* Update .gitignore
---------
Co-authored-by: PopcornDev1 <e.coiley@icloud.com>
Co-authored-by: Build <build@local>
Co-authored-by: Elliot Coiley <153072396+PopcornDev1@users.noreply.github.com>
- Removes the old data directory if Camoufox was installed before 0.5.0
- Fix messy sponsors segment & add repo status info at the top of the README
- Add camoufox/camoufox org as fallback
- Remove (experimental) next to the GeoIP by daijro source
- Format
- Enable bf cache with `enable_cache=True` #74
- Font spacing is now fixed per session #63
- Re-download (or raise error) when target install path is empty. Caused when the user cancels the download.
- Bumped minimum version to beta.15
- Added window: Tuple[int, int] argument to set a fixed width and height #50
- Experimental fix to automatically terminate Xvfb on browser.close() #49
- Bump to 0.3.1
- Python library now constrains the supported Camoufox version, and will force an update if you are out of date.
- Added support patch for multiple accepted languages #37
- Added pysocks #43
- Added README deprecation notices
- Added public launch_options command
- Bumped python library to 0.3.0
- Full support for beta.12
- Warns the user if they try to manually set the geolocation and locale.
- Move manual config documentation to the bottom of the README to discourage use.
- Make the parameters list more obvious.
- Passing in a region like `locale='US'` will generate a language based on the region, "US".
- Passing in a language like `locale='en'` will generate a region based on the language, "en".
- Fix locale parsing errors when generating using territoryInfo.xml #36