The launch-options table documents i_know_what_im_doing as silencing the
option warnings, but custom_fonts_only raised its LeakWarning without the
flag in both launchers, so it always printed and never named the flag.
Ref #1069
* 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>
* Report WebGL2's value for every parameter WebGL1 shares
Firefox 156+ creates WebGL1 on WebGL2's GL profile, so every parameter
both contexts report is one driver value. fpgen recorded Firefox 146,
which put WebGL1 on a compatibility profile, and the launchers already
copied WebGL2's line width range over WebGL1's for that reason. Two
Linux records (GeForce GTX 480 and 980) also differ in
ALIASED_POINT_SIZE_RANGE, which CreepJS checks: it flags any mirrored
WebGL1/WebGL2 parameter that differs, except the version strings and
the line width range.
The copy now covers every shared non-string parameter, in both
launchers. A test checks every recorded device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* webgl: test every shared parameter in TypeScript; record the rule's new scope
The TypeScript test still checked only the line width range, so the
launcher's new copy of every shared parameter had no TypeScript test: the
new one walks every recorded GPU and fails on main for the Linux GTX 480
(ALIASED_POINT_SIZE_RANGE). The Python line-width test is covered by the
every-parameter one and goes. webgl-browser-owned-values-follow-firefox
now says WebGL1 takes WebGL2's value for every parameter both report, with
the GTX 480/980 records as evidence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jake Writer <jake_writer@jobharvest.com>
* 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>
* 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>
* Bound the host GPU probe and fail loudly
A display that accepts connections but never answers the X handshake
left Firefox inside getContext() forever, and the launch with it. Both
launchers now give the probe's launch, page read and cleanup one
30-second deadline, and a timeout raises with the executable and
DISPLAY it was probing instead of hanging.
The Python reader runs in a daemon thread, so a browser call that
cannot be cancelled does not keep the interpreter alive after the
timeout. The TypeScript probe closes its browser on the same failure
path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Probe the host GPU in a child process so a timeout stops the browser
A thread cannot be stopped, so a probe that timed out kept its browser and
Playwright driver running until the interpreter exited, and each later launch
retried the probe and started another. The probe now runs in a child
interpreter; terminating it on a timeout closes its pipe to the driver, which
shuts the browser down. A child also starts from inside AsyncCamoufox's
running asyncio loop, which the sync API refuses.
The tests run the real probe: a stand-in browser that never answers must be
gone after the timeout, and a missing executable reports Playwright's error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jake Writer <jake_writer@jobharvest.com>
Nine jobs downloaded the fpgen model from its GitHub release on every
run, so a 504 from GitHub failed pythonlib and skipped every browser
job behind it. pin-fpgen-model.py --archive keeps the downloaded archive
in a file and installs from it when it is there, checked against the
pin either way. The fpgen-model action caches that file, keyed on
fpgen-model.json, and every job installs the model through it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream's 159 port filtered it on Windows because ANGLE decides per
device. ANGLE derives it from 16-bit normalized format support
(Caps.cpp DetermineTextureNorm16Support), which D3D11 feature level
10_0, the minimum for WebGL2, requires. Stock Firefox 159.0 on a
GeForce GTX 980 (ANGLE D3D11) lists it on WebGL2 and not WebGL1, so
every Windows identity lacked an extension stock exposes.
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>
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>
* 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>
* Pin v159.0
Camoufox beta.35 is built on Firefox 159.0 (was 158.0.1), with the PGO profiles Mozilla trained for that release. Linux arm64 is still built with the x86_64 Linux profile in 159's taskcluster/kinds/build.
* Port the Playwright bootstrap patch to Firefox 159
Firefox 159 gives each BrowsingContext field its CanSet policy inside the FIELD macro and removes the per-field CanSet() overloads. PrefersContrastOverride's old CanSet() returned IsTop(), which is {.mTopOnly = true, .mCanSet = CanSet::Unrestricted}, the policy 159 gives its sibling ForcedColorsOverride. The hunk that only shortened two mozilla::dom:: qualifiers is dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port the SessionStore popup-close guard to Firefox 159
Firefox 159 keys SessionStore's windows by a private #windowIds WeakMap instead of the aWindow.__SSi expando. maybeDontRestoreTabs looks the window up the same way onClose now does, and still returns early for a window SessionStore never registered.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Refresh two patches' context for Firefox 159
Both applied with fuzz 2. font-hijacker.patch's DWrite hunk sits where 159 moved the factory into the bundled-fonts branch, and wheel-native-ticks.patch's hunk now sits before 159's new mIsSynthesizedForTests line in SendWheelEvent. Only context lines change. The wheel flag matches what jugglerSendMouseEvent already sets for mouse input (isDOMEventSynthesized), and camoufox.cfg zeroes the user-input delay it would bypass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Drop remote-security-settings.patch; Firefox 159 ships the OneCRL import
Bug 2084311's startup import of the bundled OneCRL list is in Firefox 159's RemoteSecuritySettings.sys.mjs, so the backport's hunk reads as already applied. The certificate-revocations guard passes on 159 without it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Record stock Firefox 159.0's content-accessible chrome files
Regenerated with gen-contentaccessible-manifest.py from the stock 159.0 Linux x86_64 release (build 20261022150525). Regenerating from stock 158.0.1 reproduces the previous manifest byte for byte.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Import jsdebugger from its Firefox 159 location in Juggler
Firefox 159 moved jsdebugger.sys.mjs to moz-src:///devtools/platform/. The old resource://gre/modules/ URL no longer resolves, Runtime.js throws on load in every content process, and Playwright's launch never completes. Every other module Juggler imports still exists in 159's omni.ja.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Grant the Marionette guards system access the way Firefox 159 requires
Firefox 159 removed --remote-allow-system-access; RemoteAgent reads MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1 instead, and Marionette:SetContext refuses the chrome context without it. helpers.marionette_env() supplies it to every guard that drives Marionette.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Expose EXT_texture_norm16 on macOS and Linux WebGL2, as Firefox 159 does
Bug 1735401 took EXT_texture_norm16 out from behind webgl.enable-draft-extensions. It is exposed on WebGL2 wherever the GL has 16-bit normalized textures, core in desktop GL 3.1: every macOS (CGL GL 4.1) and x86_64 Linux WebGL2 context. Measured on stock 159.0 on M1 and on Linux llvmpipe; 158.0.1 and 146.0 do not list it. stock-gpu-parity failed on macOS on exactly this extension and passes with the change. Windows is unchanged: ANGLE decides per device from its D3D11 format support, which no recording carries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Run make clean's revert from browser/, not the source tree
The cd into the source tree persisted into the next command, so $(MAKE) revert ran inside the Firefox tree, found no such target, and left the patched tree in place. The step-by-step patch upgrade workflow starts with make clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Expose EXT_clip_control and EXT_texture_mirror_clamp_to_edge where Firefox 159 does
Both extensions are new in Firefox 159 and reach WebGL1 and WebGL2 wherever the GL backend has them. Stock 159.0 on Linux llvmpipe (x86_64 and aarch64) lists both where 158.0.1 lists neither, and stock 159.0 on Apple M1 lists neither: CGL's GL 4.1 lacks clip control (GL 4.5) and mirror clamp (GL 4.4). ANGLE's D3D11 backend sets textureMirrorClampToEdgeEXT on every device and clipControlEXT from feature level 10_0, the level WebGL2 needs, so Windows follows the rule EXT_polygon_offset_clamp already uses. Linux keys on the desktop GL mark (EXT_depth_clamp) as that rule does. stock-gpu-parity failed on Linux on exactly these two extensions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A caller who sets only navigator.userAgent marked the whole navigator domain as theirs, so fix_navigator_arch never ran. fpgen's Linux pool holds draws whose platform is another OS's beside a Linux oscpu, and those reached the page as Win32 behind a Linux user agent.
The arch fix now stands down only when the caller set navigator.platform or navigator.oscpu themselves. The regression tests pin such a draw with a fixed fingerprint, so they fail deterministically without the fix.
(cherry picked from commit f7b091c1d1533ceae016a1ef6b85c861f8c0582c)
Co-authored-by: Claude <noreply@anthropic.com>
* 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>
The launcher set layout.css.devPixelsPerPx only when the identity's
devicePixelRatio was not 1, on the assumption that the host renders at 1.
On a HiDPI host (a Retina Mac, Linux with GDK_SCALE=2, Windows at 200%) the
browser then rendered at the host's scale, so a page read devicePixelRatio 1
while (resolution: 2dppx) matched (#964). Measured on 158.0.1-beta.41 headed on a
MacBook Pro's 2x Retina panel and on an Xvfb display with GDK_SCALE=2. Both
launchers now set the pref whenever the identity carries a ratio; a pref the
caller passes still wins.
On the Retina panel, innerWidth, visualViewport and the (width) media query
are unchanged by the pref. The window draws at half its physical size there,
as a 1x display's window would.
display-scale-resolution now also launches a ratio-1 identity on a 2x host,
which fails on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
identity_seed() hashed the whole user agent, browser version included.
A saved identity relaunched on a newer browser claims the new engine
version and nothing else about the machine changes, yet its seed moved,
so every Firefox release redrew its fonts, voices, GPU and media
devices: a site holding the identity's cookies saw a different machine
behind the same profile, the change #442/#765 guard against within one
version. With the same launcher and the same fingerprint, a browser at
150.0.2 and one at 158.0 drew different fonts and a different GPU on
Windows, macOS and Linux identities alike.
The seed now hashes the UA with its rv: and Firefox/ versions taken
out, in both launchers; the OS tokens stay, so identities still differ.
Every pinned identity redraws once, on the release that carries this,
and then stays put across later ones.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(screen): cache the spoofed screen per nsScreen so availWidth costs what stock's does
getter-cost-parity failed on main (run 40142262379): screen.availHeight took
361 ns against stock Firefox 158.0's 178 ns on the CI runner, just over the 2x
bound. Under the default fingerprinting protection, GetAvailRect does stock's
work and then read the context id twice, two per-context memo entries (each a
__tls_get_addr call from libxul), the global screen size, and the context's
navigator.platform, which it copied and converted to UTF-8 on every call.
nsScreen now keeps the spoofed rect and OS for its context and re-reads them
only when RoverfoxStorageManager's generation moves (a new Generation()
accessor; the same staleness rule its own memo uses). SpoofedOSFor also takes
UTF-16, so NavigatorManager::GetSpoofedOS no longer converts.
Local, same host, fastest of 3 guard runs each (stock 88-90 ns):
availHeight, launch identity 117-122 ns -> 107-110 ns
availHeight, context identity 132-134 ns -> 107 ns
screen.width 76-78 ns -> 71 ns (stock 54-56)
Launch and context identities now cost the same, and availHeight / height is
1.5, as stock's is (it was 1.74 here, 2.3 on the runner).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(virtdisplay): count a process reaped mid-read as dead
_alive opens /proc/<pid>/stat and then reads it. When Xvfb exits between the
two, which is the moment test_xvfb_dies_with_the_process_that_started_it waits
for, the read raises ProcessLookupError (ESRCH), not FileNotFoundError, and the
test failed instead of passing (PR #950's pythonlib job).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(virtdisplay): judge Xvfb's exit on the wait loop's own reading
The loop stops when it sees Xvfb as a zombie, and the assert then read /proc
again. That second read lands while Xvfb's new parent reaps it, the window in
which open() succeeds and read() raises ESRCH. Asserting on the loop's last
reading removes the second read; _alive already counts ESRCH as gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(guards): run on the binary under test, never the installed release
audio-matches-stock failed PR #950's spoofing job with a GitHub API 403 (rate
limit). Re-encoding its config, it called get_env_vars without path=, so the
fontconfig lookup fell back to camoufox_path(): on a runner with no release
installed that fetched one through the anonymous GitHub API (31.7 s of the
guard on main) and read the released bundle, not the build under test.
launch_camoufox, which system-ui-font-spoofing uses, passed no executable_path
at all, so that guard tested an installed or downloaded release and could not
catch a regression in the build.
Both now use the binary under test, and helpers makes camoufox_path() raise in
every guard, so a fallback to the installed release fails at once on a dev box
with a cached release as well as on a runner without one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The packages downloaded uBO from AMO at fetch, pinned in
python/src/camoufox/addons.json, so a new uBO, and with #946 its filter
lists, reached users only when someone bumped the pin.
browser/scripts/fetch-ubo.py now resolves AMO's newest release (its guid
and sha256 checked) and extracts it into the package as addons/UBO/
(Contents/Resources/addons/UBO/ on macOS). Both launchers load it from
beside the binary they launch, and `camoufox fetch` no longer downloads
an addon. A build without one, an older release or an unpackaged build,
launches without uBO and warns.
A cut resolves the release once, in a ubo job ahead of tests, and hands
it to tests.yml and every build through CAMOUFOX_UBO, so a uBO published
mid-run cannot ship untested. The release's manifest.json and notes name
it. tests.yml resolves one per run and stages it into the browser every
suite uses; `make stage-ubo` does the same for a local build.
addons.json and the per-version addon cache are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default addon was fetched from AMO's latest-version URL the first time
it was needed, and that copy was reused for good. So two machines on the
same Camoufox release could run different uBlock Origin builds, depending
on the day each cache was filled, and a new uBO release reached users
without passing through CI.
python/src/camoufox/addons.json now names the build: its AMO file URL,
version and sha256. Both packages read it, check each download against the
sha256 before extracting it, and cache each version in its own directory,
addons/<name>/<version>/, so a bump installs fresh instead of reusing
another release's copy. The file's note says where a bump takes its values
from.
The install gate now checks that fetch left the pinned uBO in the cache,
and no staging directories, as it already did for the GeoIP database.
A failed download printed "Failed to download and extract UBO" and the
browser launched without the addon it was asked for. It now raises. A
complete copy another process installed meanwhile is used instead of
being dropped from the launch.
Replace the display_scale option with the one behaviour: the browser renders
at the final config's window.devicePixelRatio (layout.css.devPixelsPerPx), so
(resolution) and the CSS geometry agree with it, whether the identity was
drawn, a preset or supplied. A pref the caller passes still wins. The fpgen
draw's ratio is no longer read, which gave a supplied 2.5 identity no scale
or a scale of 2.
Headful on a real monitor, the display clamp divides by the scale, and a
window that still needs more pixels than the monitor has raises a ValueError
saying so. The monitor is only known in pixels at scale 1 on Linux, so the
scale is applied to the bound there.
New guard: display-scale-resolution (spoofing), which fails on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* 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>
After MAX_SCALE_FIT_DRAWS fresh draws that did not fit the monitor at
their display scale, or for a supplied identity that did not, the
launchers rendered at 1 without a word, which is the contradiction
display_scale exists to remove. A preset was ignored the same way.
Both now emit a LeakWarning (display_scale_unfit, display_scale_preset
in warnings.yml). It is not silenced by i_know_what_im_doing, which a
supplied fingerprint requires anyway.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fpgen draws a screen at a display scale (1536x864 is a 1920x1080 panel
at 125%) and the browser reports that devicePixelRatio, but renders at
1: (resolution: 1dppx) and the CSS geometry then contradict the screen,
a pair no real machine reports (36% of Windows draws, 74% of macOS
ones; lang315/camoufox#41).
The new launch option display_scale renders at the drawn scale through
layout.css.devPixelsPerPx, snapped to a scaling step the OS offers.
Headful on a real monitor, the identity must fit the panel physically
at that scale: fresh draws are redrawn until one does, a supplied one
that cannot stays at 1, and the display clamp bounds the physical size.
It is off by default, since it changes how every page is rendered and
how large screenshots are. Both launchers take it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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>
searchclipboardfor.middleclick is browser chrome, clipboard.autocopy only fills
the X primary selection, middlemouse.openNewWindow is overridden by the
browser's own link handling, and select popups are drawn in the parent
process. use-system-size is read only by Windows' own LookAndFeel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows Firefox has PlayReady behind EME; a Linux build cannot supply
it, so turning media.eme.enabled on claimed more than the build
delivers. The pref is no longer among the Windows behaviour defaults,
and the Python and TypeScript tests now require that it is left alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A context sets its own user agent and platform, but appVersion came only
from the launch config, so a macOS context in a Windows launch reported
"5.0 (Windows)" beside a Macintosh user agent, in the page and in its
workers.
navigator-spoofing.patch adds setNavigatorAppVersion, stored, guarded and
removed the way setNavigatorPlatform and setNavigatorUserAgent are, and
read by Navigator::GetAppVersion and WorkerNavigator::GetAppVersion before
the launch config. window-setter-seal.patch seals it with the others, and
is regenerated against Firefox 158 with every patch before it applied.
The launchers' per-context init script calls it with the appVersion
_app_version_from_user_agent already derives for the context's config,
in Python and TypeScript alike, so the rule stays in one place. The
context-app-version guard compares the page against that same function
instead of a copy of its own; the init script golden covers the setter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a download failed, maybe_download_addons removed the addon directory
unconditionally. If another process had finished installing the addon in the
meantime, that deleted its good copy, possibly while its browser was loading
it. The handler now removes the directory only when it has no manifest.json,
in both the Python and TypeScript launchers, each with a regression test.
One window remains: two processes that both find a stale, non-empty partial
directory can still interleave its removal and their renames.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The atomic extraction removed the target before renaming into it. With two
processes downloading at once, the second could delete the first's finished
addon while its browser was loading it. If the first renamed in between, the
second's rename failed on the non-empty directory, and its error handler then
deleted the good copy, so it launched without uBlock Origin.
Rename first. If the target is not empty and already holds a manifest.json,
keep it and drop the temp dir; only an incomplete target is replaced. The
TypeScript port mirrors this and gains the atomic-extraction test, and both
gain a regression test for an addon installed during extraction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`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
* Pin Firefox 157.0
Camoufox beta.33 is built on Firefox 157.0 (was 156.0.1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* e2e: expect exactly the identity's input kinds from enumerateDevices()
The probe asserted a non-empty pre-grant device list. Stock Firefox lists one
entry per input kind the machine has and no outputs, so a speaker-only identity
(about 6% of Windows draws) correctly lists nothing. Firefox 157.0's UA bump
re-seeded the Windows preset onto such a machine, and 156.0.1 returns the same
empty list for it.
Compare against the kinds the config claims instead: it still fails on an
empty list for a mic/camera identity, and it now also catches a wrong or
missing kind, a host device leaking through, or an enumerateDevices() error.
Gate-Change: Firefox 157.0's version in the UA re-seeds the Windows preset's media-device draw (pythonlib fingerprints.py from_preset -> identity_seed); verified the same empty list on 156.0.1-beta.32 and 157.0 for the no-mic/no-camera identity.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep independent window placement with the WM, which Firefox 157 stopped doing
Firefox 157 landed bug 2070008, which deleted the Unix special case in
AppWindow::SizeShell():
bool positionSet = !mIgnoreXULPosition;
#if defined(XP_UNIX) && !defined(XP_MACOSX)
// don't override WM placement on unix for independent, top-level windows
if (!parentWindow) positionSet = false;
#endif
so a top-level window now takes the position persisted in the profile's XUL
store instead of leaving placement to the window manager.
That makes window.screenX/screenY a function of leftover profile state, and a
page can read it. Measured on this branch before the fix, same identity, same
Xvfb:
throwaway profile screenX 4 screenY 4
persistent profile screenX 26 screenY 0
v156.0.1-beta.32 reports 0/0 for both, so the two session types were
indistinguishable and are no longer. fingerprint-injection.patch only answers
GetScreenX/GetScreenY from the config when window.screenX is set, and the
launcher does not draw it for every identity, so the real position shows
through whenever it is absent. A position that varies with profile type
correlates a user's fresh and persistent sessions, and it moves the browser
rect MouseDispatch.js measures (docs/input-dispatch.md).
Nobody places an automation browser's window by hand, so there is no UX here
to gain and determinism to lose. Restores the guard for independent windows
only; dependent windows are still placed relative to their parent, as upstream
intended before and after. Both profile types report 0/0 again.
Caught by typescript/tests/e2e.test.ts:506 in CI, which asserts a persistent
profile presents the same device as a throwaway one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Pin Firefox 157.0.1
Camoufox beta.33 is built on Firefox 157.0.1 (was 157.0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pin Firefox 158.0
Camoufox beta.33 is built on Firefox 158.0 (was 157.0.1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port the Playwright bootstrap patch to Firefox 158
Firefox 158 moved the code under six hunks:
- Bug 2072511 replaced HeadlessWidget::mCompositorWidget with a generic
CompositorWidgetDelegate so the compositor can live in the GPU process.
The screencast snapshot listener now reaches the in-process
HeadlessCompositorWidget through AsHeadlessCompositorWidget().
- Bug 2071024 added movementX/movementY to SynthesizeMouseEventData and
changed the mMovement coalescing check; jugglerEventId and the drag
event synthesis sit beside the new code.
- Bug 1688932 took bit 25 of nsIWebBrowserChrome's chrome flags for
CHROME_MEDIA_PIP. JUGGLER_WINDOW_EXPLICIT_SIZE keeps bit 26, the last
free one.
- Bug 2070965 made UserAgentOverride an nsCString, which moved the
context of the BrowsingContext field-namespace hunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Refresh camoufox-window-module.patch context for Firefox 158
Bug 2070772 removed PartnerLinkAttribution.sys.mjs from browser/modules,
so the module list hunk applied only with fuzz. The change is the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port config.patch to Firefox 158's top-level moz.build
Bug 2070828 appended the SBOM GeneratedFile block to the end of the
top-level moz.build, where config.patch adds the lw directory. The lw
directory is still appended last.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port the worker userAgent override to Firefox 158's nsCString
Bug 2070965 made WorkerNavigator::GetUserAgent take an nsCString, so the
navigator.userAgent override assigns the UTF-8 config value directly
instead of converting it to UTF-16.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port font-hijacker.patch to Firefox 158's gfx/thebes/moz.build
Bug 2070824 appended license declarations to gfx/thebes/moz.build after
the line the camoucfg include followed. The include is still appended
at the end of the file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port the network geolocation override to Firefox 158
Bug 2060572 moved the request's logging into the try block and made it
throw first when geo.provider.network.url is unset. The CAMOU_CONFIG
coordinates are now chosen before that check, so a configured location
is reported without depending on the provider URL, as on Firefox 156.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port the per-context userAgent to Firefox 158's nsACString getters
Bug 2070965 made Navigator::GetUserAgent and WorkerNavigator::GetUserAgent
return UTF-8 and collapsed the window's custom user agent lookup. The
per-context value is still checked first in both getters and is
converted from the UTF-16 it is stored as.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Refresh screen-spoofing.patch context for Firefox 158
nsRFPService::GetSpoofedStorageLimit, next to the declaration the patch
changes, now returns int64_t, so the hunk applied only with fuzz. The
change is the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Refresh sessionstore-popup-close-crash.patch context for Firefox 158
Firefox 158 documented SessionStore.maybeDontRestoreTabs with a JSDoc
block, so the guard applied only with fuzz. The guard is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Port webrtc-ip-spoofing.patch's include to Firefox 158
Bug 2072208 removed NS_PRINTING and the nsIPrintSettings.h include that
followed xpcpublic.h in nsGlobalWindowInner.cpp. WebRTCIPManager.h is
still included after xpcpublic.h.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Qualify webgl-spoofing's dom names in ClientWebGLContext.cpp
ClientWebGLContext.cpp declares no 'using namespace mozilla::dom'. It
compiled on Firefox 157 only because CanvasImageCache.cpp, earlier in the
same unified dom/canvas chunk, did. Bug 2048943 removed that directive
ahead of renaming nsRange to dom::Range, so the patch now names
RoverfoxStorageManager, WorkerPrivate and WebGLParamsManager with their
dom:: namespace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Record Firefox 158.0's content-accessible files and chrome names
The contentaccessible-parity guard compares a build against what stock
Firefox of the same version exposes to pages, and refuses a manifest
recorded from another release. Regenerated with
scripts/gen-contentaccessible-manifest.py from the official 158.0 Linux
x86_64 build (BuildID 20261007201254). Among the changes, Firefox 158 no
longer registers the extra-themes-previews resource host (bug 1990883
removed colorways).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Claim EXT_polygon_offset_clamp where Firefox 158 exposes it
Bug 1854003 added EXT_polygon_offset_clamp to WebGL1 and WebGL2 wherever
the GL backend clamps polygon offsets (GLFeature::polygon_offset_clamp:
GL 4.6, ARB_ or EXT_polygon_offset_clamp). fpgen's records come from
Firefox 146, so no identity claimed it, and stock-gpu-parity found stock
158.0 exposing it on this Linux host where Camoufox did not.
- Windows: ANGLE's D3D11 backend sets polygonOffsetClampEXT from feature
level 10_0 (renderer11_utils.cpp), which WebGL2 needs, so devices with
WebGL2 claim it.
- Linux: Mesa (radeonsi, llvmpipe on this host, in GL and GLES contexts)
and NVIDIA's GL 4.6 driver expose it. Recordings from a desktop GL
profile, marked by EXT_depth_clamp (96.6% of Linux records), claim it;
the GLES-only records keep what the device reported.
- macOS: release builds keep webgl.disable-angle and run WebGL on CGL's
GL 4.1, which lacks it. Metal ANGLE is Nightly-only (bug 2072535).
Both launchers place it in Firefox's alphabetical extension order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Expect EXT_polygon_offset_clamp from the backends Firefox 158 adds it on
The converter and draft-extension tests hard-coded Firefox 156's backend
extensions. The GTX 980 Linux fixture's expected lists now include
EXT_polygon_offset_clamp in Firefox's order, and the Windows device with
WebGL2 expects it beside EXT_depth_clamp; every other assertion is
unchanged. A new test derives the expectation for 100 draws per OS from
each draw itself: Windows devices with WebGL2, Linux desktop GL
recordings, never macOS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gate-Change: Firefox 158 (bug 1854003) exposes EXT_polygon_offset_clamp where GLFeature::polygon_offset_clamp holds, and ANGLE D3D11 sets it from feature level 10_0; verified in the 158.0 source (dom/canvas/WebGLExtensions.cpp, gfx/gl/GLContextFeatures.cpp, third_party/angle renderer11_utils.cpp) and by stock-gpu-parity against stock 158.0 on this host
* Follow Firefox 158's WebSocket frame callbacks in Juggler
Bug 1719394 added the HTTP channel ID to
nsIWebSocketEventListener.frameReceived and frameSent, ahead of the
frame. Juggler's listener still took (serialID, frame), so it read the
channel ID as the frame, found no opCode and dropped every frame:
Playwright's framereceived and framesent events never fired
(test_websocket.py::test_should_emit_frame_events and
test_should_reject_wait_for_event_on_close_and_error failed on 158 and
pass on 156.0.1). The listener now takes the new argument.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Key Juggler's pending promises by their Debugger.Object
Bug 2044184 removed Debugger.Object.promiseID in Firefox 158. Juggler
keyed the promises it awaits by it, so every pending promise shared the
key undefined: a second awaited evaluate overwrote the first, which then
never resolved. Playwright waits that poll in the page (waitForElementState,
selectText waiting for visibility) hung whenever another evaluate
returning a promise ran meanwhile. The Debugger.Object is unique per
promise within the debugger and serves as the key instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep the environment out of forked children's command lines
Firefox's setproctitle() marks the end of the old argv space so the
kernel shows only the new title, then copies the environment strings
right after the title, inside that space. When an environment string's
null lands on the marker, the kernel shows the whole space: the title
followed by the environment. Whether it does depends only on the length
of the install path and of the environment, so it is rare in stock
Firefox. The Firefox 158 package at the parity harness's path hit it on
the RDD process, whose /proc/PID/cmdline then ended in the launching
shell's environment instead of 'rdd'. The marker is set again after the
copy; it lies outside /proc/PID/environ, which is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The launcher pins overlay versus classic scrollbars per identity, but
the scrollbars were still drawn by the host build's theme. On a Linux
host a Windows 10 identity's classic gutter measured 12 px (GTK's);
stock Firefox on Windows measures 17. For a Windows identity on a
non-Windows host the launchers now select Windows' non-native
scrollbar style (Windows 10 or 11, following ui.useOverlayScrollbars),
at Windows' own size rather than the host's system metric. A Linux or
macOS identity, and any identity on a Windows host, is left as before.
viewport-no-rdm.py now runs for a Linux and a Windows identity: the
Linux one must show the host theme's non-zero gutter, the Windows one
stock Windows' 17 px. The skiplist's 12 px entries stay right: the
Playwright suite launches the bare binary, which claims no OS.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Linux build claiming Windows kept Linux's defaults for prefs a page
or the user can observe: EME was off ("EME has been preffed off" is a
Linux-only message), middle click pasted the X11 primary selection,
double-click left out the trailing space, fullscreen was instant,
<select> popups ignored page styling, and scrollbar track clicks
followed GTK.
The launchers now set Firefox's Windows defaults for these
(windowsBehaviourPrefs in launcher-constants.json, shared by the
Python and TypeScript launchers) when a Windows identity runs on a
non-Windows host, where upstream did nothing. Caller-supplied values
still win. Each one was checked against 156.0.1's all.js, firefox.js
and StaticPrefList.yaml and still differs between the Windows and GTK
builds, the fullscreen transition included: GTK builds default to
"0 0" there, so it is not redundant now that camoufox.cfg no longer
sets it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Linux build claiming Windows edited text the GTK way, which both the
user and the page could tell: Alt+Backspace did not undo, Shift+Delete
with nothing selected did nothing, Ctrl+Up in a textarea moved up a line
instead of to its start, Ctrl+/ selected all, Ctrl+Backspace on a rich
text selection deleted only the selection, and AltGr reported keyCode
225 where Windows reports 18.
windows-keyboard.patch switches on config input:windowsKeyboard, which
the launcher sets for Windows identities on a non-Windows host, where
upstream did nothing. The shortcut tables are Windows' own, built from
the same definitions file with the Windows platform macros; GTK's
native text bindings are skipped, including the emulated ones that
synthesized (Playwright) key events get from GetEditCommandsForTests;
AltGr reports Alt and HTML editors take Windows' caret style. Without
the key, or with it false, behaviour is unchanged. The key is
launch-wide: the shortcut tables and GTK's key handling are
process-level. The patch relies on touchscreen-fingerprint-spoofing
for /camoucfg in dom/events and was re-derived on 156.
The windows-keyboard guard checks each behaviour for a Windows and a
Linux identity, with real X11 keys where only a native event exercises
the code, so the parity leg installs xdotool and setxkbmap.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The last bit of these differs between glibc (or fdlibm) and the
Windows CRT, so one call told a page that a build claiming Windows ran
on Linux: against stock 152.0.4 on Windows, sin differed on 22, cos on
26 and tan on 30 of 1,670 inputs, pow on 45 of 1,410.
windows-crt-math.patch adds javascript.options.use_ucrt_math, which
routes them to ports of ucrtbase.dll's FMA3 code path
(browser/additions/js/src/builtin/UcrtMath*.c), keeping SpiderMonkey's
own pow fast paths. On 156 the pow hook sits in pow_libm_or_fdlibm, the
one place both callers already reach the platform pow. It is built
only for 64-bit non-Windows targets, without FP contraction. The
launcher turns it on for Windows identities on a non-Windows host,
where upstream did nothing; the TypeScript launcher does the same.
browser/tests/ucrt-math checks the C alone against ucrtbase.dll on
~127,000 results in the static job. The windows-crt-math guard checks
the browser against stock Windows Firefox cold, JIT-hot and constant
folded, with a pref-off control that must differ; a missing result
counts as a difference.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With headless="virtual", NewBrowser and AsyncNewBrowser start Xvfb
first, and only sync/async_attach_vd ties its kill() to closing the
browser. Anything that raised in between -- launch_options() on a bad
proxy or unsatisfiable constraints, the Playwright launch on a missing
binary -- left one Xvfb and its /tmp/.X<n> lock behind per failed
launch. Both now kill the display on any exception before re-raising,
as the TypeScript launcher already does.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
public_ip() probed each IP service with a 5 s timeout whether or not
it went through a proxy, and proxy_exit_geo() used 10 s. A proxied
probe adds a hop and a TLS handshake behind it, so a proxy that routes
the long way round timed out on every URL and failed the whole launch.
Lookups through a proxy now get 15 s; direct ones keep 5 s. The
TypeScript launcher sizes its per-proxy clients the same way.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
add_default_addons() took `with Lock():` on a multiprocessing.Lock made
fresh for each call, which guarded nothing: two launches in one process
both found no manifest.json and both downloaded and extracted uBO into
the same directory. The lock is now one threading.Lock for the module.
A launch in another process does not see that lock, and it trusts any
addon directory holding a manifest.json. Extraction now goes into a
sibling temp directory that is renamed into place last, so the manifest
never appears before the rest of the addon.
The TypeScript launcher serializes the same check-then-extract on one
promise chain and extracts the same way.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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>