mirror of
https://github.com/daijro/camoufox.git
synced 2026-11-19 00:07:28 +00:00
main
18
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9c473387e4 |
cpu-vendor-estimates: compute as Intel or AMD x86-64 on an ARM64 host (#1034)
* cpu-vendor-estimates: compute as Intel or AMD x86-64 on an ARM64 host general.cpu_identity 1 or 2 on an aarch64 build now gives what Firefox's x86-64 build gives on that vendor's AVX2 and FMA CPU, the reverse of the ARM64 emulation on x86-64: - Skia, Web Audio, the speex resampler and libopus compile their x86 paths for aarch64 against third_party/simde/x86emu, SIMDe's intrinsics with x86's default NaN, NaN operand order and out-of-range conversions. Skia and libopus keep the recorded vendor estimate tables. - ffvpx's FFT runs its x86-64 AVX2/FMA3 assembly translated to C by browser/scripts/x86toc.py. - The JIT, the interpreter, constant folding and Math make x86's negative default NaN, and wasm relaxed SIMD gives the x64 backend's lanes (JS::SetEmulateX86). The cpu-vendor-estimates guard now runs on an ARM64 host too, checking the Intel and AMD launches against stock x86-64. On an Apple M4 (Linux container) both match in all 46 probe keys that split the architectures, plus canvas and Opus; on a Ryzen 9850X3D the ARM64 leg still matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Regenerate the Math.cpp hunks in patch-apply order cpu-vendor-estimates.patch applies before windows-crt-math.patch, but its Math.cpp hunks were written against a tree that already had the CRT patch, so three hunks were rejected on a clean `make dir`. Each patch's Math.cpp section is now the diff from the tree its predecessors leave; the resulting file is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
21fdf1c59c |
Canvas and Opus follow a claimed CPU vendor (Intel/AMD); vendor joins the fingerprint (#1024)
* Canvas: reproduce Intel's or AMD's RCPPS/RSQRTPS, chosen per identity Skia's raster pipeline uses x86's estimate instructions for the non-separable and dodge/burn blend modes, perspective and matrix inversion. Intel and AMD implement them with different tables (the same across each vendor's generations and OSes), so canvas readback shows the host's CPU vendor. - cpu-vendor-estimates.patch: pref gfx.skia.cpu_vendor_estimates (0 host, 1 Intel, 2 AMD). When it names the other vendor, rcp_approx and rsqrt_approx in the HSW and SSE paths compute that vendor's bits from a recorded table (SkCpuEstimates.h, SkCpuEstimateTables.h). - browser/tests/cpu-estimates: records each vendor's table and checks the emulation against the native instruction over all 2^32 inputs, and against the other vendor's recorded hashes. - Launcher (Python and TypeScript): cpu_vendor option and cpu:vendor key. The identity derives it from the GPU where only one vendor carries that GPU, and otherwise draws it at Firefox's x86 share (81.4% Intel). A coherence rule warns when the two disagree. Apple Silicon gets none. - Guard cpu-vendor-estimates: stock Firefox 159 hashes from an Intel and an AMD CPU; the build matches each when told to. Audio is not affected: its render splits x86-64 from ARM64, not Intel from AMD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Opus: encode with the claimed CPU vendor's RCPPS/RSQRTPS; add the CPU probe libopus's PVQ search (celt/x86/vq_sse2.c) uses the same two estimate instructions as Skia, so a WebCodecs, MediaRecorder or WebRTC Opus stream showed the host's vendor: stock Firefox 159 gives one byte stream on Intel and another on AMD. libopus lives in libgkcodecs, which cannot read prefs, so Gecko hands it the table gfx.skia.cpu_vendor_estimates selects (opus_mozilla_set_cpu_estimates) before each encoder is created, and the SSE2 search computes the estimates from it lane by lane. The guard now also encodes one second of Opus and checks it against both vendors' stock streams, on a secure page since WebCodecs needs one. It passes on an AMD host for both vendors. browser/tests/cpu-probe/ is the probe that found it: Math, DOMMatrix, layout, canvas, WebGL, relaxed SIMD, Web Audio and WebCodecs, with stock Firefox 159 results from Intel and AMD on Linux and Windows and from an Apple M4 on macOS and Linux. Intel and AMD differ only in the six estimate-based composite operations and Opus; ARM64 differs in much more, which docs/HOST-PARITY.md now lists as not emulated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * cpu:vendor: a core count only Intel ships implies Intel No AMD x86 CPU since 2015 reports 10, 14, 18, 22 or 28 logical cores: AMD runs one or two threads per core, and its one-thread parts have 2 to 8 cores. Intel's hybrids report all of them (Core Ultra 5 225, 245K, 125H, 155H; i7-14700K). So an identity with such a hardwareConcurrency is drawn Intel, and a cpu_vendor='amd' beside it is reported and repaired. The GPU still decides first: a Radeon APU beside an Intel-only count keeps AMD and is reported, since no vendor matches both. The rule is renamed cpu-vendor-matches-hardware. The counts live in launcher-constants.json (intelOnlyCoreCounts) for both launchers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * cpu {arch, manufacturer}: ARM64 emulation on x86 alongside Intel/AMD The fingerprint's CPU is now { arch: "x86" | "arm", manufacturer } instead of a bare vendor, validated per OS (launcher-constants cpuManufacturers): e.g. Apple + x86 or AMD on macOS is rejected, as is a GPU that never sits beside the claimed CPU. general.cpu_identity = 3 makes an x86 build compute what Firefox's aarch64 build computes: - Skia: the NEON raster pipeline and blend kernels, emulated lane for lane (SkOpts_neonemu, SkNeonEmu.h, SkArmEstimates.h). - Opus: the aarch64 CELT kernels and the NEON inverse MDCT (celt_neonemu.c, celt_tx_neonemu.c, translated from celt_tx_neon.S by scripts/a64toc.py), for decode and encode. - WebAudio / wasm / NaN payloads follow the ARM rules. - libvpx: Firefox configures libvpx realtime-only for linux/arm64 and win/aarch64 (not mac/arm64), which changes WebCodecs VP9 output and rejects quality-mode VP8. The ARM64 configs are now the full encoder and realtime-only is a runtime switch (media.libvpx.realtime_only), so either build can produce either result. libvpx NEON itself is bit-exact with x86. The launchers (Python and TypeScript) set general.cpu_identity and, for an ARM Windows/Linux identity, media.libvpx.realtime_only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ARM64 identity: make the guard's probe reproducible, fail loudly in ffvpx The guard served only the probe's own files, so the two webfonts 404ed and the layout step threw. The probe page draws every input from one seeded stream, so the throw shifted every later key and made wasm relaxed SIMD and the convolver look wrong. The fonts now ship beside the probe (both freely licensed, from Firefox's layout reftests), and the guard fails on any probe step that errors where stock does not. Canvas text is rasterized at the identity's devicePixelRatio, which the launcher draws, so the guard leaves it out; at a ratio of 1 it matches the M4's. FFVPXRuntimeLinker asserts that libmozavutil exports the ARM64 switch instead of skipping it silently. cpu:vendor is kept in properties.json as removed, and the tribal rule, docs and the constants test follow the general.cpu_identity pref. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c39c5dc8e2 |
Place a proxied context where its proxy exits (#990)
* Place proxied contexts at the exit A proxy-created context now derives locale and geolocation alongside its timezone and WebRTC IP. Caller-provided values still win. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci: re-run after an unrelated flaky parity test --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Jake Writer <jake_writer@jobharvest.com> |
||
|
|
601918959f |
Report the software renderer on a host that renders in software (#1006)
A host with no working GPU driver kept a drawn GPU name, on the theory that it read as a machine whose driver failed to load. It does not. Firefox reads UNMASKED_RENDERER_WEBGL and the pixels from one GL context, so stock 159 on an RX 7900 XTX with a broken Mesa driver reports llvmpipe with the same readPixels hash as Xvfb. A GPU name over those pixels never happens on a real machine, and two reads expose it. The launchers now claim the host's software renderer as they claim its GPU, so name and pixels agree without canvas noise. A drawn identity still never picks a software renderer, and a software renderer fpgen has not recorded on that OS takes the same path as an unrecorded GPU. This reads as a server or a broken driver, and checks that flag llvmpipe will flag it. Rendering on a GPU with headless="virtual-gpu" is the way to report one. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e90abccee6 |
Firefox 159: stock parity for a driven browser (#997)
* Firefox 159: stock parity for a driven browser A page driven through Camoufox should read like stock Firefox in a person's hands. This brings the Firefox 159 port up to that. Stock defaults - Remote Settings, Safe Browsing, region detection, Push, connectivity checks and the new tab keep Firefox's defaults; Nimbus is tied to Normandy so the new tab starts without it. - No policies.json: any policy file puts Firefox in enterprise mode, which a page can see (DNS over HTTPS stands down). - Firefox's 100% release rollouts are default prefs; stock's search engines are back. - WebGL, devicePixelRatio and worker getters cost what stock's do; Linux builds use --enable-stdcxx-compat, as Mozilla's do. Juggler - Driver code defines no interfaces on the page's window, isolated and main-world evaluates included. - Input arrives as a person's: click hold, hover dwell and double-click gap; fill() and insert_text() type key by key; the wheel turns notches; moves coalesce per frame; drags behave as a GTK drag session. Input waits for Firefox's user-input gate. - Focus, Fission and bfcache stay Firefox's unless a driver needs them. - Screenshots and document.fonts.ready leave the page alone. Humanize - One engine per channel (mouse, keyboard, scroll) behind one seam in Juggler, a seed for repeatable input, and custom(fn) engines run in the caller's process (Python). The build lists its engines in humanize-engines.json. Network - A SOCKS5 proxy with a username and password works for the launch and per context. - The User-Agent header follows the context's identity. - WebRTC UDP goes through a SOCKS5 proxy's UDP ASSOCIATE relay (webrtc-socks5-udp.patch), so a page's STUN server sees the exit and the srflx is real. Nothing goes around the proxy: a page with no HTTP-loaded document behind it counts as proxied, a proxy that carries no UDP gets none, and a relay address inside the proxy's own NAT is replaced by the proxy's public one. Identity - Bundled fonts and speech voices follow the drawn identity. - The window holds the identity's size and position through startup, and on a virtual display a window outside the root is neither occluded nor refused focus. CI runs every new guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BLGoGNeymhNcr3EAQX5hJE * Paste inserted text; draw input delays from one normal helper fill() and keyboard.insert_text() typed the text key by key, a quarter of a second per character, which ran past Playwright's timeouts and is not how a person enters a whole string. They now paste: the paste shortcut (Ctrl+V, Cmd+V for a Mac platform) goes down, Firefox's own paste runs with the text through nsIEditor.pasteTransferable (a trusted paste event with the text as clipboardData, then beforeinput/input insertFromPaste), and the shortcut comes up. The shortcut's keypress, where Firefox would read the system clipboard, is cancelled in the system group, which content cannot observe; the system clipboard is never used. A page that cancels the paste or the shortcut gets nothing, and the call fails saying so. input/HumanDelay.js holds normalDelay(mean, sd, min, max), the one draw for the delays between a person's input events: the click hold (normal around 110 ms, SD 30, never under 50 ms, with no ceiling), the double-click gap, the hover dwell, the paste key's hold, and the Shift and paste modifiers' lead and trail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BLGoGNeymhNcr3EAQX5hJE * Fix driven input and headless parity * Headless with a display uses that display's GL A headless probe that failed to load EGL still recorded TEST_TYPE EGL, so Firefox refused GLX and every headless WebGL context died. Probe EGL only when there is no display, and only claim it when that probe initialized. Move spacing starts when the move is sent, so a steps path stays a 125 Hz mouse instead of one move per frame. * Fix focus, humanize-off, and WebRTC proxy parity - A stock identity mirror adds no humanize keys when humanize is off. - Keep the real focus and run the upstream focus tests. - Add the per-context WebRTC proxy flag; do not fabricate a srflx behind a proxy. - Refresh the Python/TypeScript parity tests, skiplist and docs. - Install Mesa DRI so the software WebGL guards can run. * Fix TypeScript humanize float encoding Encode humanize option values as PyFloat so a duration serializes as 1.0, matching Python, and apply Biome's import formatting. * Close a relay overflow, stop inventing srflx, and fix driven input gaps WebRTC: - A SOCKS5 relay read larger than the caller's buffer overran the stack buffer. A page-named STUN server could send one. Drop the datagram. - Remove the fabricated srflx candidate; a srflx now only comes from a STUN answer, and the guards run against a server that answers. - Juggler records each proxy it sets, so a caller's own new_context(proxy=...) cannot gather around it. This replaces the launcher's webrtc:proxied key and its page-visible setter. - Headless GL probes use the surfaceless platform without launcher plumbing. Input: - A wheel without a scroll engine takes the activation slot per notch, so a long scroll no longer stalls input in every other context. - Paste and fill work inside an iframe. - Python fill honours the caller's timeout. TypeScript humanize matches Python: off, seeds, duplicate options and the scroll warning. Guards with a missing prerequisite fail rather than pass. Add navigation-preconnect-proxied. Move the tweened click test to a skiplist pattern entry, since whether it passes depends on machine speed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Check the tweened click entry with its guard, not the audit Whether test_click_with_tweened_mouse_movement passes depends on machine speed: 0 of 20 runs on all cores here, 3 of 15 on two, and it passed on CI. The audit cannot demand a failure from it, and a pattern entry would leave its reason unchecked. A skiplist entry's checked_by now names the patch guard that checks the reason, here driven-move-coalescing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Ask the display-less GL probe for a pbuffer config Mesa's surfaceless platform has only pbuffer configs. The probe asked for the default window surface type, so eglChooseConfig matched nothing and eglCreateContext got an uninitialized config. With no GPU, a display-less headless launch then had an empty gfxInfo: no WebGL and no WebRTC H264. A host where NVIDIA's EGL answers first never reaches Mesa here, so the guards only failed on machines without a GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Open about:blank for a driver and run first-page init scripts after PageAgent A headed persistent launch opened about:home once the start page prefs went back to stock. browser.startup.page now becomes 0 only when a driver attaches, so a browser nobody drives keeps Firefox's start page. Init scripts on a page's initial document ran before PageAgent existed, so their binding calls and console messages had no listener and were lost. They now run after PageAgent has reported the page's execution contexts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Warm up the crash growth test past Firefox 159's timed startup work The parent holds up to 400 MB more for a while at fixed times after launch, in stock Firefox 159 as well. Two RSS readings taken across one of those peaks read as growth or shrinkage, and pushed the test over its limit with no leak. Warm up by time instead of by context count. The metric and limit are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Close WebRTC paths around a proxy, stop background traffic, fix driven input WebRTC behind a proxy no longer shows the host's address: ICE uses the proxy's SOCKS5 UDP relay when it has one, and UDP is dropped otherwise. A page on the bypass list behind a forced proxy is blocked on UDP and ICE TCP. A proxy hanging up straight after CONNECT no longer crashes the parent process. Remote Settings stops polling, with the page-visible lists bundled as a snapshot pinned by scripts/remote_settings.py, and Push connects on demand. fill clicks an unfocused text field and types when a page blocks paste. Click throughput across contexts is restored. The TypeScript launcher gains custom humanize engines and driver defaults, in step with Python, and caps WebGL2 MAX_UNIFORM_BLOCK_SIZE at Firefox 159's 64 KiB. docs/input-dispatch.md records a person's wheel on macOS, which is one line a notch where the driven wheel sends three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Leave the humanize engine system for its own pull request Per-channel engines, seeded streams, custom() and the keyboard and scroll-into-view plans are a separate feature. humanize keeps main's meaning here: a human cursor move, on or off, with an optional duration cap, planned by CursorTrajectory.js and paced by Pacer.js. The five per-channel config keys were declared on this branch, so they stay declared as removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Warn, not raise, on a browser that cannot read voices:speechd A new package has to launch an older build (#835, and the install gate launches the last release). A Linux identity there reports no voices, so it warns and the warning cannot be silenced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Give a macOS identity macOS's wheel A person's notched mouse on macOS sends one line for a slow notch, with no native tick, and accelerates a faster turn from there. Driven input sent Linux's three ticked lines. A macOS identity now sends lines at 16 px each, starting at one and growing, and stock's per-OS system scroll override follows the identity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Install the tracking lists where a clean build's reader looks A relative wildcard keeps its directory under recursive make and drops it under faster make. The clean build nested the attachments one directory too deep, so the classifier had no tables. An incremental objdir hid this with old links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Make two guards deterministic: the wheel's OS and a dropped relay A launch without `os` draws one, and a macOS draw now gets macOS's wheel, so the guards asserting three notches failed by the draw. They assert Linux's now. The browser flushes queued datagrams when UDP ASSOCIATE is granted, so a relay closed just after the grant could forward one, and the STUN server heard the proxy's own relay port as if it had gone around the proxy. It closes first now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
76da8386a9 |
Audio renders as stock Firefox does: remove the audio noise and audio:seed (#927)
* Let a launch leave Web Audio output unmodified The launchers seed Web Audio noise per identity so a returning identity reproduces its audio hash. A caller who wanted stock audio output had to pass audio:seed in config, and NewContext contexts still drew their own seed. audio_noise (default True, as before) set to False sends seed 0, which audio-fingerprint-manager.patch reads as no noise, and NewBrowser records it so NewContext gives its contexts seed 0 as well. An audio:seed the caller sets wins either way. Python and TypeScript take the option the same way, the launch goldens gain an audio_noise_false scenario, and both package READMEs list it. On v158.0-beta.40 an OfflineAudioContext probe renders the same with audio_noise=False across launches, in the page and in a NewContext, and matches a launch with audio:seed 0; default launches differ. Split out of #890, without its gpu_passthrough option. Co-Authored-By: coffeegrind123 <103264516+coffeegrind123@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Let a context turn its Web Audio noise off A context without an audio seed of its own takes the launch's audio:seed, so a per-context seed of 0 means "the launch's seed", not "no noise". On a browser launched with noise, no context could render stock audio. setAudioFingerprintNoise(false) stores that choice for the calling context, and AudioFingerprintManager::GetSeed returns 0 for it whatever the launch seed. The setter has its own gate and is sealed with the others; the build tester and the setter-seal guard list it. The context-audio-off guard renders an OfflineAudioContext with the noise off at launch as the reference, then on a noised launch requires a context that called the setter to match it, also after a navigation, while a plain context and a NewContext context stay noised. It fails on v158.0-beta.40, which has no such setter. Both patches were regenerated from a tree of the files the series touches, and the whole series applies to vanilla 158 without fuzz. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Replace audio_noise with fingerprint_options The launchers take one option for the noise Camoufox adds on top of an identity, in Python and TypeScript alike: fingerprint_options={"audio": {"noise": False}} # stock Web Audio fingerprint_options={"audio": {"seed": 1000433}} # fixed audio seed fingerprint_options={"canvas": {"randomize": True}} Without an audio entry the seed still follows the identity; without a canvas entry randomization is still on for another OS or GPU. Any other surface or key raises InvalidFingerprintOptions, naming the tribal rules that keep canvas pixels and glyph spacing unnoised, as do a seed outside 1 to 2**32-1 and noise off together with a seed. fingerprint= stays the fpgen identity. canvas_noise= and config={"audio:seed": N} keep working with a FutureWarning, as a deprecated GeoIP source does; either one together with the matching fingerprint_options entry raises. NewContext takes the audio entry per context. Without one a context follows the browser, read from the audio:seed the launch sent, so launch_options() and from_options launches behave the same: no noise if the launch sent 0, otherwise a fresh seed of its own. A context never takes the browser's seed, fixed or not, since two devices sharing an audio hash are linked; a per-context seed reproduces a context instead. A context with its noise off calls setAudioFingerprintNoise(false). On a noised browser that needs a build with the setter: NewContext asks the browser once, from an init script in a throwaway context, and raises on an older build rather than leave the context noised. canvas in a context raises: randomization belongs to the browser. audio_noise, context_audio(browser) and _camoufox_audio_noise are gone. The launch goldens replace audio_noise_false with audio and canvas scenarios, the init-script golden gains a seed-0 case, and the READMEs, AGENTS.md and docs/per-context-patches.md describe the option; repo callers of canvas_noise use the new form. On v158.0-beta.40, an OfflineAudioContext probe renders the same with {"audio": {"noise": False}} in the page, in a NewContext and with config audio:seed 0; default launches differ; seed 1000433 and a context seed reproduce across launches; a context turning its noise off on a noised browser raises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Audio renders as stock: remove the noise, the seed and fingerprint_options Stock Firefox has one audio fingerprint per CPU architecture. 103 runs of Firefox 152-158 on 12 CPUs gave 35.749972093850374 on every x86-64 machine and 35.74996626004577 on every ARM64 one, whatever the OS, sound device, sample rate or version. The per-identity noise put every Camoufox identity on a value no real machine renders. Browser: audio-fingerprint-manager.patch is gone, with setAudioFingerprintSeed and setAudioFingerprintNoise; font-list-spoofing, webrtc-ip-spoofing and window-setter-seal are regenerated without its context (the series applies cleanly to vanilla 158). audio:seed is marked removed in properties.json. Library (py and ts): no seed is derived or drawn, and config or config_overrides carrying audio:seed raise InvalidPropertyType pointing at the new tribal rule. fingerprint_options, never released, is reverted; canvas_noise stays as released. Tests: tribal rule audio-is-not-noised with its test; the audio-matches-stock guard replaces context-audio-off and audio-frequency-noise, holding the fpjs buffer, AnalyserNode, biquad and sine renders to the recorded stock values in several contexts and two launches while sending the seed released libraries send. build-tester counts the audio hash as must-match and fails its noise trap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * A removed audio:seed warns and is dropped; the rule lists each machine Passing audio:seed in config (or a NewContext config_overrides) no longer raises. Both launchers drop the key and emit one FutureWarning from warnings.yml (audio_seed_removed): the option was removed and audio is rendered exactly as stock Firefox renders it. The caller's dict is left as it was. Tests on both sides check the single warning and a normal launch; the launch golden records the warning in order. audio-is-not-noised now lists the evidence per machine and architecture, including the Raspberry Pi 4 runs (106 runs: 45 ARM64, 61 x86-64), the device swap, fpgen's share and what the noise produced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: coffeegrind123 <103264516+coffeegrind123@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
365883614c |
Merge pull request #894 from coffeegrind123/pr/windows-identity
Make a Windows identity on another host behave as Windows |
||
|
|
b3679d28c2 |
Say which Windows values were measured, and what a macOS host gets
The test docstring claimed every value was measured on stock Windows; four behaviour prefs were, and the rest are Firefox 158's Windows defaults from its pref files. windows-keyboard.patch's tables, text bindings and AltGr are GTK code, so on a macOS host only the editor caret style changes. The test UAs claim 158. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1524ae937b |
Say that the Windows settings belong to the browser, not the context
The CRT math, keyboard, behaviour prefs and scrollbars a Windows identity gets on another host are prefs and launch config, so they follow the OS the browser was launched with. NewContext does not refuse a context of another OS: a launch without os draws its OS, and the refusal would come and go with the draw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c58bd92b89 |
Fetch a named build with one API call, and fail fetch loudly
`camoufox fetch <repo>/<version>-<build>`, and the plain `fetch` of a release's paired build, synced every repository in repos.yml before looking the build up: one GitHub API call per source, plus a manifest download per listed release. On shared CI runners that exhausted the unauthenticated API quota. The sync also reads only the newest page of releases, so a pinned build older than the 30 newest could not be found. Both now read the build's own release, GET /releases/tags/v<version>-<build>, and apply the same asset, version-range and interface checks as the sync, which now share release_versions(). A build published under another tag (early alphas such as v146-hardware) still resolves through the sync. Every path where fetch installs nothing now exits 1: an unknown or incompatible build, a failed API call or download, and a prerelease prompt that is declined or meets end of input. Previously each printed an error and exited 0, so CI failed later at launch. Fixes #919 |
||
|
|
f30f6e8368 |
Merge pull request #912 from JWriter20/feat/virtual-gpu-display
Add headless="virtual-gpu": render on a named GPU with no monitor attached |
||
|
|
9f94b0ea46 |
Stop Xvfb when the process that launched it dies (#868)
headless="virtual" started Xvfb in its own session and stopped it only on the browser's close path. A launcher ended by a signal (timeout, a supervisor, a cancelled CI job) never reaches that path, so its Xvfb ran forever, together with the session bus and desktop helpers Firefox autolaunched on that display. Both packages now exec Xvfb through `setpriv --pdeathsig TERM`, so the kernel signals it when its launcher dies, even by SIGKILL. SIGTERM lets Xvfb remove its own lock and socket, and the autolaunched bus exits when it loses its X connection. setpriv comes from util-linux. The leak suite missed this because every crash test keeps the launcher alive to tear down, and leak_check follows only our descendants, which an orphan no longer is. test_launcher_sigkill_leaves_nothing_on_its_display kills the launcher and looks machine-wide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
813d9bb199 |
Behave as on an IPv4-only network when the host's IPv6 disagrees with geoip (#857)
* Behave as on an IPv4-only network when the host's IPv6 disagrees with geoip (#849) With geoip and an IPv4 address, both launchers set network.dns.disableIPv6. That stops AAAA lookups only, so IPv6-only sites failed with NS_ERROR_UNKNOWN_HOST (#849), while a URL with an IPv6 literal still connected and WebRTC still gathered IPv6 candidates. A page could read the host's IPv6 address, and no real network resolves names to IPv4 only while IPv6 literals connect. Without a proxy, sites see this host's own addresses, and the identity comes from its IPv4 address. The launcher now looks up the host's public IPv6 address too. When it geolocates to the identity's timezone and region, IPv6 stays on, as on any dual-stack network. Otherwise, or when the host has no IPv6 route, it sets the new network:ipv4Only config key, with a LeakWarning when an IPv6 address was found elsewhere. Behind a proxy nothing changes: the browser reaches sites only through it. network:ipv4Only makes the browser behave as a host with no IPv6 route: lookups return IPv4 addresses only, TCP connections to a routable IPv6 address fail with PR_NETWORK_UNREACHABLE_ERROR as the kernel's would, HTTP/3 refuses IPv6 peers, and ICE gathers no routable IPv6 address. Loopback, link-local and IPv4-mapped addresses keep working, as they do on such a host. NetAddr::IsUnreachableOnIPv4OnlyNetwork is the one definition all of these use. ipv4-only-network.py checks it in a network namespace with a dual-stack interface: with the key off every IPv6 path works, with it on IPv6 literals and AAAA-only names fail at once, dual-stack names use IPv4, and WebRTC offers no IPv6 candidate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Allow user namespaces for the IPv4-only network guard in CI Ubuntu 24.04's AppArmor denies unprivileged user namespaces to programs without a profile, so the guard's `unshare -rnm` failed on the runner. The spoofing leg now lifts that restriction on the throwaway runner, and the guard says which setting to change when it is denied locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ee9e3185f2 |
Fix CI review findings: deterministic proxy skips, shipped fontconfig as a browser input, doc links and paths
- The skiplist audit runs each entry in its own pytest process without upstream's reruns. test_browsercontext_proxy.py shares one browser, and HTTPS-First's per-host exception means only its first proxied navigation fails, so every navigating test there is listed and each is audited from a fresh browser. Record HTTPS-First staying on in ci/tribal-rules.yml. - Drop the test_worker locale entry and its overlay test: upstream v1.62.0 asserts the same ru-RU behaviour, so the entry passed the audit. - browser/bundle/fontconfig ships in every package, so it is now a browser input (BROWSER_DIRS and the resolve grep), with a test that every --includes path is one. - Revert the binary-config-keys allowance: a driver-only PR tests the release paired by source digest, which covers properties.json. - Playwright guards use helpers.resolve_binary and a new helpers.launch_kwargs instead of per-file copies. - Docs: absolute links in the PyPI/npm READMEs, a Python development section, repository-root markers in the patch guide, Playwright porting merged into it, fpgen-js, the moved fpgen pin and font-constant files, and the canvas-noise and browser/executable_path launcher changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d9fa53e96b | fix: ensuring documentation matches behavior for pinning | ||
|
|
159aebedac |
Claim the host's GPU on its own OS, cover canvas and WebGPU on another, and follow Firefox 156 for browser-owned GPU values
Canvas, WebGL and WebGPU output come from the real OS, driver and GPU. On the host's OS the identity now claims the GPU Firefox actually renders with; on another OS canvas and WebGL readback use privacy.resistFingerprinting's canvas placeholder (canvas_noise, on by default only for another OS, with a LeakWarning). WebGPU follows the claimed device: navigator.gpu only where Firefox exposes it (Windows, Apple Silicon), and the host's adapter only when the identity claims the host's hardware GPU. Otherwise gfx.blacklist.webgpu marks the device blocked, so requestAdapter() resolves to null as it does for real users on a blocked or software GPU. The pref is read at startup, so it goes through CAMOU_PREFS. Spoofed avail-screen and touch values now pass through stock baseline fingerprinting protection for the claimed platform (screen-spoofing, touchscreen-fingerprint-spoofing). fpgen's records are mostly Firefox 146, and two WebGL values are decided by the browser rather than the device: Windows extension lists now include EXT_depth_clamp (ANGLE's D3D11 backend reports it on every feature level in 156), and WebGL1's ALIASED_LINE_WIDTH_RANGE takes the device's WebGL2 value (Firefox 156 no longer forces a compatibility profile for WebGL1 on Linux). A new parity guard, stock-gpu-parity, compares stock Firefox at the build's version, stock Firefox at the release fpgen recorded, and Camoufox claiming the host's GPU, and fails when Camoufox differs from stock on a value the two stock releases disagree on. Decisions are recorded in ci/tribal-rules.yml (cross-os-canvas-is-the-rfp-placeholder, webgpu-follows-the-claimed-device, webgl-browser-owned-values-follow-firefox). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
658806eb23 | chore: major code cleanup/refactor |