Commit Graph
49 Commits
Author SHA1 Message Date
coffeegrind123andClaude Opus 5.5 8907d3ef00 Keep a pinned identity's draws across browser upgrades
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>
2026-10-26 18:13:55 +00:00
Jake WriterandClaude Opus 5.5 8589f980fd fix(screen): screen.availWidth/availHeight cost parity with stock (fixes main's getter-cost-parity failure) (#950)
* 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>
2026-10-25 06:31:03 +00:00
Jake WriterandClaude Opus 5.5 7ac4b2132c Bundle AMO's newest uBlock Origin in every browser release
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>
2026-10-24 16:31:23 -06:00
shbernal b9ee656980 Pin uBlock Origin to one release per package
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.
2026-10-24 09:57:46 +02:00
Jake Writer 3cbe32f6c6 Merge pull request #934 from JWriter20/feat/display-scale
Always render at the identity's devicePixelRatio
2026-10-24 03:17:04 +00:00
shbernal 8d586f5b0c Fail a launch whose default addon cannot be downloaded
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.
2026-10-24 02:20:52 +00:00
Jake Writer ef24c00c18 Merge remote-tracking branch 'upstream/main' into pr934-ff 2026-10-23 19:46:48 -06:00
Jake WriterandClaude Opus 5.5 55fb795ba4 Always render at the identity's devicePixelRatio
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>
2026-10-23 19:46:48 -06:00
Jake WriterandClaude Opus 5.5 46b9189263 Merge upstream/main into feat/display-scale
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 19:46:48 -06:00
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>
2026-10-24 01:33:25 +00:00
Jake Writer 365883614c Merge pull request #894 from coffeegrind123/pr/windows-identity
Make a Windows identity on another host behave as Windows
2026-10-23 21:13:57 +00:00
Jake WriterandClaude Opus 5.5 1aafe467ed Warn when display_scale renders at 1
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>
2026-10-23 14:49:13 -06:00
coffeegrind123andClaude Opus 5.5 e212071839 Render at the identity's display scale with display_scale=True
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>
2026-10-23 14:49:13 -06:00
Jake Writer c4f76c3ce1 Merge pull request #920 from shbernal/fix/919-fetch-pinned-single-call
Fetch a named build with one API call, and fail fetch loudly
2026-10-23 18:50:26 +00:00
Jake WriterandClaude Opus 5.5 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>
2026-10-23 11:28:16 -06:00
Jake WriterandClaude Opus 5.5 9bb4181cf8 Windows identity: drop behaviour prefs no page can observe
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>
2026-10-23 11:27:16 -06:00
Jake Writer 942ed371f7 Merge pull request #892 from coffeegrind123/pr/context-appversion
Derive a context's appVersion from its own user agent
2026-10-23 16:05:10 +00:00
Jake WriterandClaude Opus 5.5 4e2515bc64 Leave EME at the build's default for Windows identities
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>
2026-10-22 16:30:26 -06:00
Jake WriterandClaude Opus 5.5 853722885f Merge remote-tracking branch 'upstream/main' into pr/windows-identity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:04:23 -06:00
Jake WriterandClaude Opus 5.5 39c428ad3e Give a context its appVersion through setNavigatorAppVersion
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>
2026-10-22 15:40:20 -06:00
Jake Writer 59ac5006cf Merge pull request #902 from coffeegrind123/pr/addons-concurrent
Download the default addons once under concurrent launches
2026-10-22 21:32:43 +00:00
Jake WriterandClaude Opus 5.5 51e8757bf7 Keep a complete addon when this launch's download fails
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>
2026-10-22 12:37:14 -06:00
Jake WriterandClaude Opus 5.5 8f06d85bf5 Keep a complete addon another process installed first
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>
2026-10-22 12:34:58 -06:00
shbernal 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
2026-10-20 18:30:13 +02:00
Jake WriterandClaude Opus 5.5 8599955e0f Update to Firefox 158.0 (#914)
* 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>
2026-10-19 17:08:56 +00:00
Jake Writer f30f6e8368 Merge pull request #912 from JWriter20/feat/virtual-gpu-display
Add headless="virtual-gpu": render on a named GPU with no monitor attached
2026-10-19 01:51:33 +00:00
Jake Writer f1bcbb335f Merge pull request #908 from coffeegrind123/pr/vd-cleanup
Stop the virtual display when a Python launch fails
2026-10-18 21:10:50 +00:00
coffeegrind123andClaude Opus 5.5 e3b76b2acf Draw Windows' scrollbars for Windows identities on another host
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>
2026-10-18 09:54:01 +03:00
coffeegrind123andClaude Opus 5.5 4812579537 Set Windows behaviour defaults for Windows identities
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>
2026-10-18 09:54:00 +03:00
coffeegrind123andClaude Opus 5.5 1912e974fa Give Windows identities Windows' keyboard
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>
2026-10-18 09:53:59 +03:00
coffeegrind123andClaude Opus 5.5 580f4aee99 Compute Math.sin/cos/tan/pow as the Windows CRT does
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>
2026-10-18 09:53:59 +03:00
coffeegrind123andClaude Opus 5.5 0618f75ecb Stop the virtual display when a Python launch fails
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>
2026-10-18 09:53:24 +03:00
coffeegrind123andClaude Opus 5.5 a158f3686d Give exit-IP lookups through a proxy 15 seconds
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>
2026-10-18 09:53:22 +03:00
coffeegrind123andClaude Opus 5.5 7246d98e70 Download the default addons once under concurrent launches
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>
2026-10-18 09:53:19 +03:00
Jake WriterandClaude Opus 5.5 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>
2026-10-16 13:31:03 -06:00
Jake Writer 6f74fa06df Merge pull request #866 from RinZ27/fix/ip-validation-parsing
Validate IP addresses with standard library parsers instead of regex
2026-10-16 19:12:09 +00:00
Jake WriterandClaude Opus 5.5 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>
2026-10-15 20:41:50 +00:00
RinZ27 1830dcd091 Validate IP addresses with standard library parsers instead of regex
In both Python and TypeScript launchers, IP validation used loose regular
expressions that allowed octets above 255 for IPv4 (e.g. 999.999.999.999)
and malformed colon sequences for IPv6 (e.g. :, :::, 1::2::3).

Downstream, these invalid addresses reached WebRTC init script generation
and MaxMind DB lookups, causing broken script calls or unhandled errors
instead of rejecting them early with InvalidIP.

Replaced the regex checks with ipaddress in Python and node:net in
TypeScript, and added test cases covering the boundary strings.
2026-10-15 11:35:55 +07:00
Jake WriterandClaude Opus 5.5 4559d018dc Date fpgen's model within signed 32-bit time, so read-only Lambda launches work (#856)
The pinned model files were dated 2100-01-01 so fpgen's five-week refresh
never replaces them. AWS Lambda keeps file times as signed 32-bit seconds and
reads that date back as 1963, so every launch tried to re-date the files,
Lambda's read-only filesystem raised EROFS, and the launch failed. Had the
error been ignored, fpgen would have seen a 1963 file as stale and fetched
its own model over the pin.

The files are now dated 2038-01-01, which a 32-bit filesystem stores as is.
A file that cannot be re-dated for any reason, not only a permission error,
is also left alone while fpgen still considers it current, so a read-only
image built with the earlier date keeps working. A stale file that cannot be
re-dated still fails the launch.

Fixes #854.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 03:27:42 +00:00
Jake WriterandClaude Opus 5.5 0bb4f14b74 Keep the caller's launch inputs unchanged, and claim the avail screen and touch points baseline protection reports
launch_options/launchOptions filled the caller's config, prefs, args and
addons in place. A config reused for a second launch then carried the first
identity's webGl:vendor in, which read as a GPU the caller named: the second
launch covered its canvas while claiming the host's GPU. The TypeScript
end-to-end test caught it through its Python probe, which calls
launch_options before Camoufox with the same kwargs. Both launchers now work
on copies.

Firefox's baseline fingerprinting protection reports the available screen as
the screen less a fixed taskbar for the claimed OS (48px Windows, 76px macOS,
none on Linux) and collapses more than one touch point to 5, and the browser
applies that to the spoofed values. The launchers still claimed fpgen's
recorded avail rect, adjusted by fix_screen_no_taskbar, so a Linux identity's
config said availHeight 1053 while the page read 1080. follow_baseline_protection
/ followBaselineProtection replaces it and claims what the browser reports.

The end-to-end test now compares a covered canvas by being covered (its
readback is random on every read, so its size was too), launches the
NewContext scenario with canvas_noise, since an uncovered browser binds its
contexts to the host, and checks a headful launch against its own config,
because Xvfb can render on another device than headless.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:02 -06:00
Jake WriterandClaude Opus 5.5 0c98d2b734 Look up each spoof by the document's own context, and make the OS, popups and startup prefs per-context or loud
- One helper, RoverfoxStorageManager::UserContextId(), reads the user
  context from a principal, node or window. Every per-context lookup used
  the browsing context instead, which a document from
  createHTMLDocument() or DOMParser does not have, so a canvas there read
  context 0, which held whichever context set its values last: a page
  could see two GPUs (#839) or another context's font list. The setters
  no longer copy their values into context 0.
- UNMASKED_RENDERER_WEBGL and UNMASKED_VENDOR_WEBGL apply stock's
  fingerprinting-protection checks before the spoofed value, as RENDERER
  does, so the two never disagree.
- system-ui, the CSS2 system fonts and WebRTC's fabricated port use the
  context's own OS (NavigatorManager::GetSpoofedOS), not the launch's, so
  a macOS context of a Windows launch no longer resolves Segoe UI.
- CamoufoxWindow sizes only windows the driver opens; a page's popup keeps
  the size it asked for.
- camoufox.cfg applies CAMOU_PREFS through the default branch and quits
  with the reason on stderr when a pref cannot be applied, instead of
  starting without it.
- Delete commented-out prefs; shorten the setter-seal comments into a
  tribal rule; mark the unread navigator.buildID key removed.
- Refresh five patches that only applied with fuzz; the patched tree is
  byte-identical.
- Guards: webgl-renderer-pair covers data and DOMParser documents, two
  contexts and the unmasked vendor; new context-os-system-font and
  popup-window-size; startup-prefs covers the loader's failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:02 -06:00
Jake WriterandClaude Opus 5.5 12b81fdada Read the font bundle only through its group layout, and run a lost test
gen-fonts-json.py and verify-fonts.py read the groups listed in groups.json
through _font_bundle.read_groups(). Neither falls back to the per-OS layout
the group layout replaced any more: a bundle without groups.json is an error.

test_salt_of_equal_objects_is_equal had slipped inside another test's body
and never ran; it is back in TestPinnedIdentityIsStable and passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:39:01 -06:00
Jake WriterandClaude Opus 5.5 6c3850f60a Remove dead and duplicated code across the launchers, scripts and CI
Values both launchers hard-coded (marker fonts, the Windows 11 fonts, the
Apple Silicon and Intel Mac core and panel tables, plausible DPR and core
counts, the macOS MacinTalk/Eloquence voices, the cache prefs) now live in
python/src/camoufox/launcher-constants.json, which the TypeScript package
ships as a data file. gen-fonts-json.py and verify-fonts.py read the same
file, so the drifted PingFang marker copy is gone (fonts.json regenerates
byte-identical) and verify-fonts no longer ast-parses fingerprints.py.

- Drop the duplicate fpgen model pin under browser/scripts/data; the TS
  test checks the fpgen package's MODEL_PIN against the Python copy.
- Move pin-fpgen-model.py and clean-fingerprint-data.py to python/scripts.
- Delete the font licence report (font-metrics/licences.py and its saved
  output, open-fonts.txt): the bundle ships as built, so the report checks
  nothing.
- Delete unreferenced files: cleanfonts.sh, python/examples,
  typescript/renovate.json.
- Delete dead code: classify_installs, remove_mmdb, write_upstream_sh,
  bump_release, unused test constants and fixture helpers, the
  _virtual_display attribute writes, package.py's pre-groups font copy (a
  missing groups.json now fails).
- Share require_bundle, zip_entries, gh_headers and parse_shard instead of
  keeping copies; fold GitHubDownloader into CamoufoxFetcher in both
  launchers.
- TS raises ValueError where Python does, and `camoufox version` prints the
  fpgen package version as Python does.
- Python tests get src/ from pytest's pythonpath instead of sys.path
  inserts; skips that hid untested paths now assert or test the behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:38:55 -06:00
Jake WriterandClaude Opus 5.5 5c1fd578ad Read a build's version from its own bundle, refuse browser= with a binary, and cover the canvas whenever the GPU is not the host's
- A named executable's application.ini is found beside it, or in
  Contents/Resources of a macOS app bundle (pkgman.build_file / buildFile),
  and a named executable without one raises instead of borrowing the paired
  build's version. browser= on macOS no longer raises CamoufoxNotInstalled
  or claims the wrong Firefox major.
- browser= together with executable_path or CAMOUFOX_EXECUTABLE_PATH raises
  ValueError instead of silently dropping browser=.
- One function per launcher (plan_rendering / planRendering) decides whether
  the identity claims the host's GPU or the canvas is covered, for the launch
  and for the host identity its contexts keep. A GPU named by webgl_config or
  a preset, or a host GPU fpgen never recorded, now covers the canvas by
  default, and such a browser binds no context to the host.
- setWebgpu keeps a caller pref set to null, as Python's setdefault does.
- stock-gpu-parity verifies SHA256SUMS.asc against Mozilla's release key and
  uses camoufox.webgl.recorded_devices instead of private helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:38:46 -06:00
Jake Writer d9fa53e96b fix: ensuring documentation matches behavior for pinning 2026-10-08 19:59:50 -06:00
Jake WriterandClaude Opus 5.5 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>
2026-10-08 19:08:30 -06:00
Jake Writer a4a9286452 fix: minor leak fixes, patch cleanup, webgpu windows/mac leak fix 2026-10-07 15:32:24 -06:00
Jake Writer 914b575e8f feat: working on cleaning up and fixing patches 2026-10-06 20:47:49 -06:00
Jake Writer 658806eb23 chore: major code cleanup/refactor 2026-10-06 19:10:22 -06:00