{"owner":"daijro","repo":"camoufox","hasSkills":true,"totalSkillsCount":2,"totalTokensCount":4965,"categories":["root-instruction","claude-rule"],"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","CLAUDE.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\nInstructions for any coding agent working in this repository or writing code\nagainst Camoufox: Claude Code, Codex, Cursor, Copilot, Gemini or anything else.\n`CLAUDE.md` and `GEMINI.md` only import this file, and `.aider.conf.yml` reads\nit, so there is one set of rules. Edit them here.\n\n---\n\n## Before you touch anything\n\n1. **This repository is public.** The professionalism rules below govern every\n   line, commit message, PR title and comment you write.\n2. **Read [`ci/tribal-rules.yml`](ci/tribal-rules.yml).** It lists the decisions\n   this repo has already made, each with its evidence. Many are checked by\n   `browser/tests/native/test_tribal_rules.py`. Do not reopen one without new\n   evidence. When a new decision is argued and settled, add it there with its\n   citation.\n3. **Branch off `main`. Never commit or push to `main`.** Every change is a pull\n   request tied to a GitHub issue ([`CONTRIBUTING.md`](CONTRIBUTING.md)).\n\n## Before you write a function\n\nSearch for an existing implementation first: `ci/`, `browser/scripts/` and\n`browser/additions/`, and for launcher code the drivers in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Launcher changes\n(Python and TypeScript, fingerprints, the CLI, the MCP server) are made there,\nnever here: this repository holds the browser patches, the build and the\nrelease wrapper. If something close\nexists, extend it rather than forking it. Duplicated logic is a serious defect\nhere, because the copies drift and a fingerprint built from two drifting copies\nis detectable.\n\n## Professionalism\n\nA public repository is a finished product. People judge the project by what\nis in it, and they will not ask what a file was for.\n\n- **No garbage.** No scratch files, diagnostic scripts, saved test output,\n  logs, debug logging, commented-out code, dead code, placeholder text, stub\n  docs, or `TODO`s left as notes to self.\n- **Nothing private reaches this repo.** That includes proprietary results,\n  private repo names, and per-vector stealth detail. `ci/run_sundial.py` reports\n  a grade and a count; the vectors never leave that module.\n- Write commits and PR titles for a stranger reading them in a year.\n- **Documentation is never stale.** Update the README, `docs/` and the package\n  READMEs in the same pull request as the code that changed them, never\n  \"later\". Every snippet must run as written.\n\n## Code\n\n- **Less code.** More code is a cost, not an achievement. Make minimal, general\n  changes, and delete dead code when you find it.\n- **No band-aids.** Fix the main flow. A hard-coded value or a special case at\n  the call site is a bug relocated, not fixed.\n- **Fallbacks are a last resort.** They turn a loud failure into a silent wrong\n  answer, and in an anti-detect browser a silent wrong answer is a fingerprint.\n  Fail loudly instead.\n- **Check real data before inventing a value.** Every spoofed value must be\n  something a real device reports. Take it from the recorded distributions\n  (fpgen, the driver's data files in camoucore), not from memory.\n- **Read the provider's docs** before writing against a third-party API or a\n  Firefox internal. Never infer an endpoint, pref or field from memory.\n- **Comments say why, in a sentence or two.** Simple code needs none. A longer\n  explanation is a decision: put it in `ci/tribal-rules.yml` or `docs/`.\n\n## Tests\n\n- **Run the failing test, not the whole suite.** CI runs the full pipeline on\n  every pull request.\n- **Write test output to a log file and grep the file.** Piping a run straight\n  into `grep` throws away output you will need. Delete the log afterwards.\n- **Every bug gets a regression test, in this order:** reproduce it with a test\n  and confirm the test fails, fix the bug, confirm the test passes, then land\n  both.\n- **No flakes.** An intermittent failure means something is non-deterministic.\n  Fix that behaviour. Never retry, loosen a threshold or skip the test to get\n  green. A timing check measures what the browser did, never the driver's\n  sleep: the browser sees a `wait_for_timeout(n)` as n ms plus the driver's\n  and its own latency, which is unbounded on a loaded runner. Bound such a\n  quantity on one side (at least what n ms allows), and check order with\n  event order (nothing after the keyup), not with counts. A guard that waits\n  for something to be freed or settle polls to a deadline instead of\n  sleeping a fixed time. A guard that fails only on a loaded runner may be\n  showing a real difference from Firefox under load (driven key repeats\n  burst where Firefox skips them): compare stock Firefox under the same load\n  before deciding the check is wrong. Before trusting a fix, run the guard\n  many times on the CI runners, and break the code it guards to see it fail.\n- **A missing prerequisite fails in CI; it never passes as a skip.** A skip\n  reads as green, so a job that forgot to install something passes having\n  tested nothing.\n- **When local and CI disagree, name the mechanism and fix it in the repo.**\n  Typical causes are git-ignored inputs, skipped prerequisites and cold-cache\n  races. A fresh clone is a sanity check, not a fix.\n- **Never write a test just to pass, or code just to pass a test.**\n\n## Security\n\n- **Never commit a credential.** That covers code, config, fixtures, logs and\n  commit messages. CI secrets live in GitHub Actions secrets.\n- **Least privilege** for workflows and tokens. Grant `permissions:` per job,\n  and only what that job needs.\n- **Adding a dependency is a decision.** Say why in the pull request, and commit\n  the lockfile.\n\n## Working with the maintainers\n\n- Say when a direction is wrong, before starting, and give the reason.\n- Review your own diff the way a strict senior reviewer would. You are biased\n  toward what you just wrote.\n- Explain plainly and briefly.\n\n## Parallel work\n\n- **Separate pull requests:** one agent per task, each in its own git worktree,\n  running at the same time.\n- **One pull request with independent slow parts:** use subagents in worktrees.\n  Merge each part into your branch as it finishes, then delete the worktrees.\n- **Shared files or an ordering requirement:** use one agent.\n\n---\n\n# Repository\n\n## What this is\n\nCamoufox is an anti-detect Firefox for web scraping and automation. This repo\nis **not the Firefox source**. It is a build system that fetches upstream\nFirefox, applies `browser/patches/` and copies in `browser/additions/`, and\nproduces the browser. Fingerprint spoofing happens in C++ and in Juggler, not in\ninjected JavaScript, so a page cannot see it.\n\n`browser/upstream.sh` pins `version` and `release`. `browser/Makefile` sources\nand exports it, so every script sees them. Run `make` from `browser/`. The\nFirefox tree lives in `browser/camoufox-<version>-<release>/`. It is generated:\npersist a change there as a patch, never as an edit to that tree.\n\n| Path | What it is |\n|---|---|\n| `browser/` | The browser build: `Makefile`, `upstream.sh`, `multibuild.py`, `Dockerfile`, and the directories below. |\n| `browser/patches/` | Diffs applied to Firefox: one per behaviour at the top level, plus `playwright/`, `librewolf/` and `ghostery/`. Browser behaviour changes here. |\n| `browser/additions/camoucfg/` | The C++ config layer. `MaskConfig.hpp` reads `CAMOU_CONFIG`, which the patches consult. |\n| `browser/additions/juggler/` | Camoufox's Juggler, Playwright's Firefox protocol. The page agent runs in an isolated world. `input/` holds `MouseDispatch.js` (every synthesized mouse event) and `HumanDelay.js`; the browser adds no humanization of its own ([`docs/humanize.md`](docs/humanize.md)). |\n| `browser/settings/` | `camoufox.cfg` (prefs), `properties.json` (every config key and its type; a key the browser stops reading is marked `removed`, never deleted). |\n| `browser/scripts/` | `patch.py` applies patches and writes the mozconfig; `copy-additions.sh`, `package.py`, `install-deps.sh`, font tooling. |\n| `browser/assets/` | Mozconfigs, README images. |\n| `browser/bundle/` | The per-OS `fontconfig/` files and `FONTS-README.txt`. The fonts are a release asset (`make fonts-extract`), pinned by `browser/scripts/data/font-bundle.json`. |\n| `browser/tests/` | Browser test suites (below): `build-tester/`, `native/`, `service/`, `playwright/`. |\n| `browser/INTERFACE` | The launch interface this build speaks. A driver accepts a range of it ([`ci/README.md`](ci/README.md#the-driver)). |\n| `pyproject.toml`, `camoufox/`, `camoufox_pin/`, `npm/` | The `camoufox` release wrapper on PyPI and npm: camoucore's launcher (`camoucore.camoufox`) under the `camoufox` name, one alias stub per module, an exact `camoucore` pin, and the browser pin that `release.yml` stamps. MIT (`camoufox/LICENSE`, `npm/LICENSE`). No launcher code: `ci/check_no_driver.py` fails a PR that adds any, and `ci/check_wrapper.py` checks an install against camoucore ([`ci/README.md`](ci/README.md#the-driver)). |\n| `ci/` | The test pipeline (below). `ci/tribal-rules.yml` holds the settled decisions. |\n| `docs/` | Design notes and maintenance guides. |\n\n## Building\n\nThe build runs on **Linux**. Windows and macOS binaries are cross-compiled from\nit. `mach` needs Python 3.11 or newer.\n\n```bash\ncd browser\nmake dir                       # fetch Firefox, copy additions, apply every patch\nmake bootstrap                 # one time: scripts/install-deps.sh + mach bootstrap\nmake build                     # ./mach build\nmake run                       # run the build (wipes ~/.camoufox)\nmake package-linux arch=x86_64 # or package-macos / package-windows\npython3 multibuild.py --target linux windows macos --arch x86_64 arm64\npython3 multibuild.py --target windows macos --arch x86_64 --preflight  # compile what the patches touch, in minutes\n```\n\nA pull request builds Linux x86_64 only. CI preflights the other release\ntargets, and `--preflight` does the same locally for a patch with code for\nanother OS or CPU.\n\nEvery build, a local one included, is optimized as stock is\n([`builds-are-optimized-like-stock`](ci/tribal-rules.yml)): with the PGO\nprofile Mozilla trained for the same Firefox, cross-language LTO (full on\nx86_64 Linux and Windows, thin elsewhere) and Rust SIMD, from\n`browser/assets/base.mozconfig`. `make dir` installs the Rust release Mozilla\nbuilds the tree with and fetches the profile pinned in\n`browser/scripts/data/pgo-profiles.json`; after bumping `upstream.sh`, run\n`python3 scripts/pgo.py pin` and `python3 scripts/remote_settings.py pin` (the\npage-visible lists, bundled so the browser never polls for them). Install `ccache`. It caches compiles but not the\nLTO link, so an incremental build still relinks libxul across C++ and Rust.\n\n## Changing a patch\n\nNever hand-edit a `.patch` file. Edit the tree, then write the diff, from\n`browser/`:\n\n```bash\nmake dir && make first-checkpoint          # a new patch: checkpoint, edit, then\nmake diff > patches/my-change.patch        # (git add -N new files first)\n\nmake dir && make workspace ./patches/x.patch   # an existing patch: edit, then\nmake diff > patches/x.patch\n```\n\n`make patch` and `make unpatch` apply or reverse one patch. `make revert` resets\nthe tree to unpatched Firefox. Every make target is described in\n[`docs/patch-upgrading-guide.md`](docs/patch-upgrading-guide.md#the-source-tree-and-its-make-targets),\nwhich also covers porting patches to a new Firefox and porting Playwright. Keep\nthe `Makefile` diff minimal: host dependencies belong in\n`browser/scripts/install-deps.sh`.\n\n## Testing\n\n`ci/` is the whole pipeline. It runs the same way locally and on a pull request\n([`ci/README.md`](ci/README.md), which lists every runner). Branch protection\nrequires one check, **`All tests passed`**. Run the suite that covers your\nchange while you work:\n\n| You changed | Run |\n|---|---|\n| Patches, C++, Juggler | `python3 -m ci.run_build_tester --binary <camoufox-bin>` (the anti-detect suite) and `python3 -m ci.run_patch_guards --binary <camoufox-bin>` (one guard per shipped behaviour, in three groups: `--group spoofing|automation|parity`) |\n| Automation behaviour | `make -C browser tests`, the upstream Playwright suite with `ci/skiplist.yml` applied |\n| `ci/` itself | `python3 -m pytest ci/tests -q` |\n\n- **`browser/tests/playwright/` is not a fork of Playwright's tests.** It holds\n  only `patches/` and `camoufox/`. A deliberate difference from upstream goes\n  in `ci/skiplist.yml`, with its reason.\n- **Tests against an unpackaged build** need `make -C browser stage-fonts` first.\n  Without it the browser has no content fonts.\n- **The stealth grade** (`ci/run_sundial.py`) reports a letter and a count, never\n  the individual vectors.\n\n---\n\n# Using Camoufox\n\nThe drivers are the `camoufox` packages on PyPI and npm (`pip install\n\"camoufox[geoip]\"`, `npm i camoufox`), the launcher in the `camoucore`\npackage under the `camoufox` name. Its source, issues and docs, the\nfull reference for every launch option, the CLI and examples, are in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Every\nconfig key and its type is in\n[`browser/settings/properties.json`](browser/settings/properties.json). Keep\nthis section in step with the launcher options.\n\n## Public API\n\n| Python | TypeScript | Returns |\n|---|---|---|\n| `camoufox.sync_api.Camoufox(**opts)` (context manager) | `Camoufox(opts)` | `Browser`, or `BrowserContext` with `persistent_context` |\n| `camoufox.async_api.AsyncCamoufox(**opts)` (async context manager) | `AsyncCamoufox(opts)` (alias of `Camoufox`) | same |\n| `camoufox.sync_api.NewBrowser(playwright, **opts)` | `NewBrowser(firefox, opts)` | same, on your own Playwright instance |\n| `camoufox.async_api.AsyncNewBrowser(playwright, **opts)` | `AsyncNewBrowser` (alias) | same |\n| `camoufox.sync_api.NewContext(browser, **kw)` | `NewContext(browser, opts)` | `BrowserContext` with its own identity |\n| `camoufox.async_api.AsyncNewContext(browser, **kw)` | `AsyncNewContext` (alias) | same |\n| `camoufox.launch_options(**opts)` | `launchOptions(opts)` | kwargs for `firefox.launch()` (TS: camelCase keys) |\n| `camoufox.server.launch_server(**opts)` | `launchServer(opts)` | Python blocks and prints the ws endpoint; TS returns a `BrowserServer` |\n| `camoufox.DefaultAddons.UBO` | `\"UBO\"` | default addon id for `exclude_addons` |\n| `camoufox.fingerprints.Screen(max_width=, max_height=, min_width=, min_height=)` | `Screen({ maxWidth, ... })` or a plain object | bound for `screen` |\n\n## Pitfalls\n\n- **Do not set identity values by hand.** Do not pass Playwright's `user_agent`, or `navigator.*`, `headers.User-Agent`, `screen.*`, `window.*`, `timezone` or `geolocation:*` in `config`. The identity is drawn as a whole; overriding one value leaves the rest describing a different machine. Use `os`, `screen`, `window`, `locale` and `geoip` instead. Manual config keys print a `LeakWarning`. The coherence checks never replace a key the caller set: one that contradicts the rest of the identity (a Mac at colorDepth 24, a macOS devicePixelRatio of 1.5) is kept, with a second `LeakWarning` that `i_know_what_im_doing` does not silence. Drawn values are repaired; every macOS identity reports colorDepth 30.\n- **Use `geoip=True` with a proxy.** Without it the timezone and locale are the identity's, not the proxy's, and a warning is printed.\n- **`page.evaluate` is isolated.** It cannot read globals the page defined. Use `main_world_eval=True` and prefix the script with `mw:`. Without the option, a `mw:` evaluate fails with \"Main world evaluation is disabled\". `mw:` cannot return a handle (`evaluate_handle`).\n- **Leave the viewport alone.** When the window size is spoofed, new pages default to `no_viewport=True`; forcing a `viewport` asks the window to resize to something the identity does not claim.\n- **The OS counts clicks and repeats keys.** A press's `detail` follows the identity's OS, not `click_count`: presses count up only when quick and in place (`dblclick` is). A key held with `keyboard.down` repeats until `keyboard.up`, with that OS's delay and interval ([docs/input-dispatch.md](docs/input-dispatch.md#click-count)).\n- **`is_mobile` is ignored** (with a warning). Camoufox has desktop identities only.\n- **Persistent contexts** need `persistent_context=True` and `user_data_dir`, and cannot be served by `launch_server`.\n- **`headless=\"virtual\"`** needs Linux, `Xvfb` and `setpriv` from util-linux (`CannotFindXvfb`, `VirtualDisplayNotSupported` otherwise). Xvfb has no GPU, so canvas and WebGL render in software and the identity reports `llvmpipe`.\n- **`headless=\"virtual-gpu\"`** renders on one GPU, named by `gpu=` or `CAMOUFOX_GPU` (a PCI address is the stable choice); several GPUs and no selector raise `AmbiguousGpuSelection`. Without root it needs Xorg.wrap allowed to start Xorg as root for any user, and the card's config in `/etc/X11`; `python -m camoufox gpu-setup <gpu> | sudo sh` does both, and every failure that setup would fix ends with that command. A browser that does not render on the card raises `GpuSoftwareFallback` (`require_gpu=False` warns). Every error is a `VirtualDisplayError`. `gpu` and `require_gpu` are not `launch_options()` arguments.\n- **`os` values are lowercase** `windows`, `macos`, `linux`; anything else raises `InvalidOS`.\n- **`geoip` in Python needs the extra**: `pip install \"camoufox[geoip]\"`, else `NotInstalledGeoIPExtra`.\n- **`InvalidIP`** is raised when the public-IP or proxy exit-IP lookup fails, or when `webrtc_ip` is not a valid IPv4/IPv6 address. Pass `webrtc_ip`, `timezone_id`, `locale` and `geolocation` to `NewContext` to skip the lookup.\n- **`InvalidProxy`** means the proxy `server` string could not be parsed.\n- **`UnknownIPLocation`**: the IP is not in the GeoIP database; pass `locale` and set coordinates another way.\n- **Version ceilings:** Playwright below 1.63; Node.js 22.15 or newer.\n- **Each package release is paired with one browser build.** `camoufox set` overrides it (with a warning at launch), the `browser` option overrides it for one launch, and `camoufox set --release` restores it.\n- **`browser` and `executable_path` are exclusive**: passing `browser` with `executable_path`, or while `CAMOUFOX_EXECUTABLE_PATH` is set, raises `ValueError`.\n- **Canvas is not noised on the host's OS**: the identity claims the host's GPU or software renderer (`llvmpipe` on Linux), and the canvas hash is stable per machine. An identity on another OS, or claiming a GPU that is not the host's (`webgl_config`, a preset's GPU, or a host GPU fpgen never recorded), gets `privacy.resistFingerprinting`'s random canvas readback (as in LibreWolf), with a `LeakWarning`; `canvas_noise=True`/`False` forces it. It is per browser: contexts of a browser without it claim the host's OS and GPU, and `NewContext` raises for another OS or GPU.\n- **A Windows launch on another host is Windows for every context.** The Windows CRT math, the Windows keyboard (GTK only: on a macOS host just the editor caret style), the behaviour prefs and the scrollbars (docs/HOST-PARITY.md) are prefs and launch config, so they belong to the browser, not the context. A `macos` or `linux` context on that browser has them too; a Windows context on a browser launched as macOS or Linux has the host's. `NewContext` does not refuse either, because a launch without `os` draws its OS, and the refusal would depend on that draw. To mix OSes, pass `os` at launch for the one whose behaviour matters, or use one browser per OS.\n","CLAUDE.md":"@AGENTS.md\n"},"files":{"AGENTS.md":"# AGENTS.md\n\nInstructions for any coding agent working in this repository or writing code\nagainst Camoufox: Claude Code, Codex, Cursor, Copilot, Gemini or anything else.\n`CLAUDE.md` and `GEMINI.md` only import this file, and `.aider.conf.yml` reads\nit, so there is one set of rules. Edit them here.\n\n---\n\n## Before you touch anything\n\n1. **This repository is public.** The professionalism rules below govern every\n   line, commit message, PR title and comment you write.\n2. **Read [`ci/tribal-rules.yml`](ci/tribal-rules.yml).** It lists the decisions\n   this repo has already made, each with its evidence. Many are checked by\n   `browser/tests/native/test_tribal_rules.py`. Do not reopen one without new\n   evidence. When a new decision is argued and settled, add it there with its\n   citation.\n3. **Branch off `main`. Never commit or push to `main`.** Every change is a pull\n   request tied to a GitHub issue ([`CONTRIBUTING.md`](CONTRIBUTING.md)).\n\n## Before you write a function\n\nSearch for an existing implementation first: `ci/`, `browser/scripts/` and\n`browser/additions/`, and for launcher code the drivers in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Launcher changes\n(Python and TypeScript, fingerprints, the CLI, the MCP server) are made there,\nnever here: this repository holds the browser patches, the build and the\nrelease wrapper. If something close\nexists, extend it rather than forking it. Duplicated logic is a serious defect\nhere, because the copies drift and a fingerprint built from two drifting copies\nis detectable.\n\n## Professionalism\n\nA public repository is a finished product. People judge the project by what\nis in it, and they will not ask what a file was for.\n\n- **No garbage.** No scratch files, diagnostic scripts, saved test output,\n  logs, debug logging, commented-out code, dead code, placeholder text, stub\n  docs, or `TODO`s left as notes to self.\n- **Nothing private reaches this repo.** That includes proprietary results,\n  private repo names, and per-vector stealth detail. `ci/run_sundial.py` reports\n  a grade and a count; the vectors never leave that module.\n- Write commits and PR titles for a stranger reading them in a year.\n- **Documentation is never stale.** Update the README, `docs/` and the package\n  READMEs in the same pull request as the code that changed them, never\n  \"later\". Every snippet must run as written.\n\n## Code\n\n- **Less code.** More code is a cost, not an achievement. Make minimal, general\n  changes, and delete dead code when you find it.\n- **No band-aids.** Fix the main flow. A hard-coded value or a special case at\n  the call site is a bug relocated, not fixed.\n- **Fallbacks are a last resort.** They turn a loud failure into a silent wrong\n  answer, and in an anti-detect browser a silent wrong answer is a fingerprint.\n  Fail loudly instead.\n- **Check real data before inventing a value.** Every spoofed value must be\n  something a real device reports. Take it from the recorded distributions\n  (fpgen, the driver's data files in camoucore), not from memory.\n- **Read the provider's docs** before writing against a third-party API or a\n  Firefox internal. Never infer an endpoint, pref or field from memory.\n- **Comments say why, in a sentence or two.** Simple code needs none. A longer\n  explanation is a decision: put it in `ci/tribal-rules.yml` or `docs/`.\n\n## Tests\n\n- **Run the failing test, not the whole suite.** CI runs the full pipeline on\n  every pull request.\n- **Write test output to a log file and grep the file.** Piping a run straight\n  into `grep` throws away output you will need. Delete the log afterwards.\n- **Every bug gets a regression test, in this order:** reproduce it with a test\n  and confirm the test fails, fix the bug, confirm the test passes, then land\n  both.\n- **No flakes.** An intermittent failure means something is non-deterministic.\n  Fix that behaviour. Never retry, loosen a threshold or skip the test to get\n  green. A timing check measures what the browser did, never the driver's\n  sleep: the browser sees a `wait_for_timeout(n)` as n ms plus the driver's\n  and its own latency, which is unbounded on a loaded runner. Bound such a\n  quantity on one side (at least what n ms allows), and check order with\n  event order (nothing after the keyup), not with counts. A guard that waits\n  for something to be freed or settle polls to a deadline instead of\n  sleeping a fixed time. A guard that fails only on a loaded runner may be\n  showing a real difference from Firefox under load (driven key repeats\n  burst where Firefox skips them): compare stock Firefox under the same load\n  before deciding the check is wrong. Before trusting a fix, run the guard\n  many times on the CI runners, and break the code it guards to see it fail.\n- **A missing prerequisite fails in CI; it never passes as a skip.** A skip\n  reads as green, so a job that forgot to install something passes having\n  tested nothing.\n- **When local and CI disagree, name the mechanism and fix it in the repo.**\n  Typical causes are git-ignored inputs, skipped prerequisites and cold-cache\n  races. A fresh clone is a sanity check, not a fix.\n- **Never write a test just to pass, or code just to pass a test.**\n\n## Security\n\n- **Never commit a credential.** That covers code, config, fixtures, logs and\n  commit messages. CI secrets live in GitHub Actions secrets.\n- **Least privilege** for workflows and tokens. Grant `permissions:` per job,\n  and only what that job needs.\n- **Adding a dependency is a decision.** Say why in the pull request, and commit\n  the lockfile.\n\n## Working with the maintainers\n\n- Say when a direction is wrong, before starting, and give the reason.\n- Review your own diff the way a strict senior reviewer would. You are biased\n  toward what you just wrote.\n- Explain plainly and briefly.\n\n## Parallel work\n\n- **Separate pull requests:** one agent per task, each in its own git worktree,\n  running at the same time.\n- **One pull request with independent slow parts:** use subagents in worktrees.\n  Merge each part into your branch as it finishes, then delete the worktrees.\n- **Shared files or an ordering requirement:** use one agent.\n\n---\n\n# Repository\n\n## What this is\n\nCamoufox is an anti-detect Firefox for web scraping and automation. This repo\nis **not the Firefox source**. It is a build system that fetches upstream\nFirefox, applies `browser/patches/` and copies in `browser/additions/`, and\nproduces the browser. Fingerprint spoofing happens in C++ and in Juggler, not in\ninjected JavaScript, so a page cannot see it.\n\n`browser/upstream.sh` pins `version` and `release`. `browser/Makefile` sources\nand exports it, so every script sees them. Run `make` from `browser/`. The\nFirefox tree lives in `browser/camoufox-<version>-<release>/`. It is generated:\npersist a change there as a patch, never as an edit to that tree.\n\n| Path | What it is |\n|---|---|\n| `browser/` | The browser build: `Makefile`, `upstream.sh`, `multibuild.py`, `Dockerfile`, and the directories below. |\n| `browser/patches/` | Diffs applied to Firefox: one per behaviour at the top level, plus `playwright/`, `librewolf/` and `ghostery/`. Browser behaviour changes here. |\n| `browser/additions/camoucfg/` | The C++ config layer. `MaskConfig.hpp` reads `CAMOU_CONFIG`, which the patches consult. |\n| `browser/additions/juggler/` | Camoufox's Juggler, Playwright's Firefox protocol. The page agent runs in an isolated world. `input/` holds `MouseDispatch.js` (every synthesized mouse event) and `HumanDelay.js`; the browser adds no humanization of its own ([`docs/humanize.md`](docs/humanize.md)). |\n| `browser/settings/` | `camoufox.cfg` (prefs), `properties.json` (every config key and its type; a key the browser stops reading is marked `removed`, never deleted). |\n| `browser/scripts/` | `patch.py` applies patches and writes the mozconfig; `copy-additions.sh`, `package.py`, `install-deps.sh`, font tooling. |\n| `browser/assets/` | Mozconfigs, README images. |\n| `browser/bundle/` | The per-OS `fontconfig/` files and `FONTS-README.txt`. The fonts are a release asset (`make fonts-extract`), pinned by `browser/scripts/data/font-bundle.json`. |\n| `browser/tests/` | Browser test suites (below): `build-tester/`, `native/`, `service/`, `playwright/`. |\n| `browser/INTERFACE` | The launch interface this build speaks. A driver accepts a range of it ([`ci/README.md`](ci/README.md#the-driver)). |\n| `pyproject.toml`, `camoufox/`, `camoufox_pin/`, `npm/` | The `camoufox` release wrapper on PyPI and npm: camoucore's launcher (`camoucore.camoufox`) under the `camoufox` name, one alias stub per module, an exact `camoucore` pin, and the browser pin that `release.yml` stamps. MIT (`camoufox/LICENSE`, `npm/LICENSE`). No launcher code: `ci/check_no_driver.py` fails a PR that adds any, and `ci/check_wrapper.py` checks an install against camoucore ([`ci/README.md`](ci/README.md#the-driver)). |\n| `ci/` | The test pipeline (below). `ci/tribal-rules.yml` holds the settled decisions. |\n| `docs/` | Design notes and maintenance guides. |\n\n## Building\n\nThe build runs on **Linux**. Windows and macOS binaries are cross-compiled from\nit. `mach` needs Python 3.11 or newer.\n\n```bash\ncd browser\nmake dir                       # fetch Firefox, copy additions, apply every patch\nmake bootstrap                 # one time: scripts/install-deps.sh + mach bootstrap\nmake build                     # ./mach build\nmake run                       # run the build (wipes ~/.camoufox)\nmake package-linux arch=x86_64 # or package-macos / package-windows\npython3 multibuild.py --target linux windows macos --arch x86_64 arm64\npython3 multibuild.py --target windows macos --arch x86_64 --preflight  # compile what the patches touch, in minutes\n```\n\nA pull request builds Linux x86_64 only. CI preflights the other release\ntargets, and `--preflight` does the same locally for a patch with code for\nanother OS or CPU.\n\nEvery build, a local one included, is optimized as stock is\n([`builds-are-optimized-like-stock`](ci/tribal-rules.yml)): with the PGO\nprofile Mozilla trained for the same Firefox, cross-language LTO (full on\nx86_64 Linux and Windows, thin elsewhere) and Rust SIMD, from\n`browser/assets/base.mozconfig`. `make dir` installs the Rust release Mozilla\nbuilds the tree with and fetches the profile pinned in\n`browser/scripts/data/pgo-profiles.json`; after bumping `upstream.sh`, run\n`python3 scripts/pgo.py pin` and `python3 scripts/remote_settings.py pin` (the\npage-visible lists, bundled so the browser never polls for them). Install `ccache`. It caches compiles but not the\nLTO link, so an incremental build still relinks libxul across C++ and Rust.\n\n## Changing a patch\n\nNever hand-edit a `.patch` file. Edit the tree, then write the diff, from\n`browser/`:\n\n```bash\nmake dir && make first-checkpoint          # a new patch: checkpoint, edit, then\nmake diff > patches/my-change.patch        # (git add -N new files first)\n\nmake dir && make workspace ./patches/x.patch   # an existing patch: edit, then\nmake diff > patches/x.patch\n```\n\n`make patch` and `make unpatch` apply or reverse one patch. `make revert` resets\nthe tree to unpatched Firefox. Every make target is described in\n[`docs/patch-upgrading-guide.md`](docs/patch-upgrading-guide.md#the-source-tree-and-its-make-targets),\nwhich also covers porting patches to a new Firefox and porting Playwright. Keep\nthe `Makefile` diff minimal: host dependencies belong in\n`browser/scripts/install-deps.sh`.\n\n## Testing\n\n`ci/` is the whole pipeline. It runs the same way locally and on a pull request\n([`ci/README.md`](ci/README.md), which lists every runner). Branch protection\nrequires one check, **`All tests passed`**. Run the suite that covers your\nchange while you work:\n\n| You changed | Run |\n|---|---|\n| Patches, C++, Juggler | `python3 -m ci.run_build_tester --binary <camoufox-bin>` (the anti-detect suite) and `python3 -m ci.run_patch_guards --binary <camoufox-bin>` (one guard per shipped behaviour, in three groups: `--group spoofing|automation|parity`) |\n| Automation behaviour | `make -C browser tests`, the upstream Playwright suite with `ci/skiplist.yml` applied |\n| `ci/` itself | `python3 -m pytest ci/tests -q` |\n\n- **`browser/tests/playwright/` is not a fork of Playwright's tests.** It holds\n  only `patches/` and `camoufox/`. A deliberate difference from upstream goes\n  in `ci/skiplist.yml`, with its reason.\n- **Tests against an unpackaged build** need `make -C browser stage-fonts` first.\n  Without it the browser has no content fonts.\n- **The stealth grade** (`ci/run_sundial.py`) reports a letter and a count, never\n  the individual vectors.\n\n---\n\n# Using Camoufox\n\nThe drivers are the `camoufox` packages on PyPI and npm (`pip install\n\"camoufox[geoip]\"`, `npm i camoufox`), the launcher in the `camoucore`\npackage under the `camoufox` name. Its source, issues and docs, the\nfull reference for every launch option, the CLI and examples, are in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Every\nconfig key and its type is in\n[`browser/settings/properties.json`](browser/settings/properties.json). Keep\nthis section in step with the launcher options.\n\n## Public API\n\n| Python | TypeScript | Returns |\n|---|---|---|\n| `camoufox.sync_api.Camoufox(**opts)` (context manager) | `Camoufox(opts)` | `Browser`, or `BrowserContext` with `persistent_context` |\n| `camoufox.async_api.AsyncCamoufox(**opts)` (async context manager) | `AsyncCamoufox(opts)` (alias of `Camoufox`) | same |\n| `camoufox.sync_api.NewBrowser(playwright, **opts)` | `NewBrowser(firefox, opts)` | same, on your own Playwright instance |\n| `camoufox.async_api.AsyncNewBrowser(playwright, **opts)` | `AsyncNewBrowser` (alias) | same |\n| `camoufox.sync_api.NewContext(browser, **kw)` | `NewContext(browser, opts)` | `BrowserContext` with its own identity |\n| `camoufox.async_api.AsyncNewContext(browser, **kw)` | `AsyncNewContext` (alias) | same |\n| `camoufox.launch_options(**opts)` | `launchOptions(opts)` | kwargs for `firefox.launch()` (TS: camelCase keys) |\n| `camoufox.server.launch_server(**opts)` | `launchServer(opts)` | Python blocks and prints the ws endpoint; TS returns a `BrowserServer` |\n| `camoufox.DefaultAddons.UBO` | `\"UBO\"` | default addon id for `exclude_addons` |\n| `camoufox.fingerprints.Screen(max_width=, max_height=, min_width=, min_height=)` | `Screen({ maxWidth, ... })` or a plain object | bound for `screen` |\n\n## Pitfalls\n\n- **Do not set identity values by hand.** Do not pass Playwright's `user_agent`, or `navigator.*`, `headers.User-Agent`, `screen.*`, `window.*`, `timezone` or `geolocation:*` in `config`. The identity is drawn as a whole; overriding one value leaves the rest describing a different machine. Use `os`, `screen`, `window`, `locale` and `geoip` instead. Manual config keys print a `LeakWarning`. The coherence checks never replace a key the caller set: one that contradicts the rest of the identity (a Mac at colorDepth 24, a macOS devicePixelRatio of 1.5) is kept, with a second `LeakWarning` that `i_know_what_im_doing` does not silence. Drawn values are repaired; every macOS identity reports colorDepth 30.\n- **Use `geoip=True` with a proxy.** Without it the timezone and locale are the identity's, not the proxy's, and a warning is printed.\n- **`page.evaluate` is isolated.** It cannot read globals the page defined. Use `main_world_eval=True` and prefix the script with `mw:`. Without the option, a `mw:` evaluate fails with \"Main world evaluation is disabled\". `mw:` cannot return a handle (`evaluate_handle`).\n- **Leave the viewport alone.** When the window size is spoofed, new pages default to `no_viewport=True`; forcing a `viewport` asks the window to resize to something the identity does not claim.\n- **The OS counts clicks and repeats keys.** A press's `detail` follows the identity's OS, not `click_count`: presses count up only when quick and in place (`dblclick` is). A key held with `keyboard.down` repeats until `keyboard.up`, with that OS's delay and interval ([docs/input-dispatch.md](docs/input-dispatch.md#click-count)).\n- **`is_mobile` is ignored** (with a warning). Camoufox has desktop identities only.\n- **Persistent contexts** need `persistent_context=True` and `user_data_dir`, and cannot be served by `launch_server`.\n- **`headless=\"virtual\"`** needs Linux, `Xvfb` and `setpriv` from util-linux (`CannotFindXvfb`, `VirtualDisplayNotSupported` otherwise). Xvfb has no GPU, so canvas and WebGL render in software and the identity reports `llvmpipe`.\n- **`headless=\"virtual-gpu\"`** renders on one GPU, named by `gpu=` or `CAMOUFOX_GPU` (a PCI address is the stable choice); several GPUs and no selector raise `AmbiguousGpuSelection`. Without root it needs Xorg.wrap allowed to start Xorg as root for any user, and the card's config in `/etc/X11`; `python -m camoufox gpu-setup <gpu> | sudo sh` does both, and every failure that setup would fix ends with that command. A browser that does not render on the card raises `GpuSoftwareFallback` (`require_gpu=False` warns). Every error is a `VirtualDisplayError`. `gpu` and `require_gpu` are not `launch_options()` arguments.\n- **`os` values are lowercase** `windows`, `macos`, `linux`; anything else raises `InvalidOS`.\n- **`geoip` in Python needs the extra**: `pip install \"camoufox[geoip]\"`, else `NotInstalledGeoIPExtra`.\n- **`InvalidIP`** is raised when the public-IP or proxy exit-IP lookup fails, or when `webrtc_ip` is not a valid IPv4/IPv6 address. Pass `webrtc_ip`, `timezone_id`, `locale` and `geolocation` to `NewContext` to skip the lookup.\n- **`InvalidProxy`** means the proxy `server` string could not be parsed.\n- **`UnknownIPLocation`**: the IP is not in the GeoIP database; pass `locale` and set coordinates another way.\n- **Version ceilings:** Playwright below 1.63; Node.js 22.15 or newer.\n- **Each package release is paired with one browser build.** `camoufox set` overrides it (with a warning at launch), the `browser` option overrides it for one launch, and `camoufox set --release` restores it.\n- **`browser` and `executable_path` are exclusive**: passing `browser` with `executable_path`, or while `CAMOUFOX_EXECUTABLE_PATH` is set, raises `ValueError`.\n- **Canvas is not noised on the host's OS**: the identity claims the host's GPU or software renderer (`llvmpipe` on Linux), and the canvas hash is stable per machine. An identity on another OS, or claiming a GPU that is not the host's (`webgl_config`, a preset's GPU, or a host GPU fpgen never recorded), gets `privacy.resistFingerprinting`'s random canvas readback (as in LibreWolf), with a `LeakWarning`; `canvas_noise=True`/`False` forces it. It is per browser: contexts of a browser without it claim the host's OS and GPU, and `NewContext` raises for another OS or GPU.\n- **A Windows launch on another host is Windows for every context.** The Windows CRT math, the Windows keyboard (GTK only: on a macOS host just the editor caret style), the behaviour prefs and the scrollbars (docs/HOST-PARITY.md) are prefs and launch config, so they belong to the browser, not the context. A `macos` or `linux` context on that browser has them too; a Windows context on a browser launched as macOS or Linux has the host's. `NewContext` does not refuse either, because a launch without `os` draws its OS, and the refusal would depend on that draw. To mix OSes, pass `os` at launch for the one whose behaviour matters, or use one browser per OS.\n","CLAUDE.md":"@AGENTS.md\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/daijro/camoufox/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# AGENTS.md\n\nInstructions for any coding agent working in this repository or writing code\nagainst Camoufox: Claude Code, Codex, Cursor, Copilot, Gemini or anything else.\n`CLAUDE.md` and `GEMINI.md` only import this file, and `.aider.conf.yml` reads\nit, so there is one set of rules. Edit them here.\n\n---\n\n## Before you touch anything\n\n1. **This repository is public.** The professionalism rules below govern every\n   line, commit message, PR title and comment you write.\n2. **Read [`ci/tribal-rules.yml`](ci/tribal-rules.yml).** It lists the decisions\n   this repo has already made, each with its evidence. Many are checked by\n   `browser/tests/native/test_tribal_rules.py`. Do not reopen one without new\n   evidence. When a new decision is argued and settled, add it there with its\n   citation.\n3. **Branch off `main`. Never commit or push to `main`.** Every change is a pull\n   request tied to a GitHub issue ([`CONTRIBUTING.md`](CONTRIBUTING.md)).\n\n## Before you write a function\n\nSearch for an existing implementation first: `ci/`, `browser/scripts/` and\n`browser/additions/`, and for launcher code the drivers in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Launcher changes\n(Python and TypeScript, fingerprints, the CLI, the MCP server) are made there,\nnever here: this repository holds the browser patches, the build and the\nrelease wrapper. If something close\nexists, extend it rather than forking it. Duplicated logic is a serious defect\nhere, because the copies drift and a fingerprint built from two drifting copies\nis detectable.\n\n## Professionalism\n\nA public repository is a finished product. People judge the project by what\nis in it, and they will not ask what a file was for.\n\n- **No garbage.** No scratch files, diagnostic scripts, saved test output,\n  logs, debug logging, commented-out code, dead code, placeholder text, stub\n  docs, or `TODO`s left as notes to self.\n- **Nothing private reaches this repo.** That includes proprietary results,\n  private repo names, and per-vector stealth detail. `ci/run_sundial.py` reports\n  a grade and a count; the vectors never leave that module.\n- Write commits and PR titles for a stranger reading them in a year.\n- **Documentation is never stale.** Update the README, `docs/` and the package\n  READMEs in the same pull request as the code that changed them, never\n  \"later\". Every snippet must run as written.\n\n## Code\n\n- **Less code.** More code is a cost, not an achievement. Make minimal, general\n  changes, and delete dead code when you find it.\n- **No band-aids.** Fix the main flow. A hard-coded value or a special case at\n  the call site is a bug relocated, not fixed.\n- **Fallbacks are a last resort.** They turn a loud failure into a silent wrong\n  answer, and in an anti-detect browser a silent wrong answer is a fingerprint.\n  Fail loudly instead.\n- **Check real data before inventing a value.** Every spoofed value must be\n  something a real device reports. Take it from the recorded distributions\n  (fpgen, the driver's data files in camoucore), not from memory.\n- **Read the provider's docs** before writing against a third-party API or a\n  Firefox internal. Never infer an endpoint, pref or field from memory.\n- **Comments say why, in a sentence or two.** Simple code needs none. A longer\n  explanation is a decision: put it in `ci/tribal-rules.yml` or `docs/`.\n\n## Tests\n\n- **Run the failing test, not the whole suite.** CI runs the full pipeline on\n  every pull request.\n- **Write test output to a log file and grep the file.** Piping a run straight\n  into `grep` throws away output you will need. Delete the log afterwards.\n- **Every bug gets a regression test, in this order:** reproduce it with a test\n  and confirm the test fails, fix the bug, confirm the test passes, then land\n  both.\n- **No flakes.** An intermittent failure means something is non-deterministic.\n  Fix that behaviour. Never retry, loosen a threshold or skip the test to get\n  green. A timing check measures what the browser did, never the driver's\n  sleep: the browser sees a `wait_for_timeout(n)` as n ms plus the driver's\n  and its own latency, which is unbounded on a loaded runner. Bound such a\n  quantity on one side (at least what n ms allows), and check order with\n  event order (nothing after the keyup), not with counts. A guard that waits\n  for something to be freed or settle polls to a deadline instead of\n  sleeping a fixed time. A guard that fails only on a loaded runner may be\n  showing a real difference from Firefox under load (driven key repeats\n  burst where Firefox skips them): compare stock Firefox under the same load\n  before deciding the check is wrong. Before trusting a fix, run the guard\n  many times on the CI runners, and break the code it guards to see it fail.\n- **A missing prerequisite fails in CI; it never passes as a skip.** A skip\n  reads as green, so a job that forgot to install something passes having\n  tested nothing.\n- **When local and CI disagree, name the mechanism and fix it in the repo.**\n  Typical causes are git-ignored inputs, skipped prerequisites and cold-cache\n  races. A fresh clone is a sanity check, not a fix.\n- **Never write a test just to pass, or code just to pass a test.**\n\n## Security\n\n- **Never commit a credential.** That covers code, config, fixtures, logs and\n  commit messages. CI secrets live in GitHub Actions secrets.\n- **Least privilege** for workflows and tokens. Grant `permissions:` per job,\n  and only what that job needs.\n- **Adding a dependency is a decision.** Say why in the pull request, and commit\n  the lockfile.\n\n## Working with the maintainers\n\n- Say when a direction is wrong, before starting, and give the reason.\n- Review your own diff the way a strict senior reviewer would. You are biased\n  toward what you just wrote.\n- Explain plainly and briefly.\n\n## Parallel work\n\n- **Separate pull requests:** one agent per task, each in its own git worktree,\n  running at the same time.\n- **One pull request with independent slow parts:** use subagents in worktrees.\n  Merge each part into your branch as it finishes, then delete the worktrees.\n- **Shared files or an ordering requirement:** use one agent.\n\n---\n\n# Repository\n\n## What this is\n\nCamoufox is an anti-detect Firefox for web scraping and automation. This repo\nis **not the Firefox source**. It is a build system that fetches upstream\nFirefox, applies `browser/patches/` and copies in `browser/additions/`, and\nproduces the browser. Fingerprint spoofing happens in C++ and in Juggler, not in\ninjected JavaScript, so a page cannot see it.\n\n`browser/upstream.sh` pins `version` and `release`. `browser/Makefile` sources\nand exports it, so every script sees them. Run `make` from `browser/`. The\nFirefox tree lives in `browser/camoufox-<version>-<release>/`. It is generated:\npersist a change there as a patch, never as an edit to that tree.\n\n| Path | What it is |\n|---|---|\n| `browser/` | The browser build: `Makefile`, `upstream.sh`, `multibuild.py`, `Dockerfile`, and the directories below. |\n| `browser/patches/` | Diffs applied to Firefox: one per behaviour at the top level, plus `playwright/`, `librewolf/` and `ghostery/`. Browser behaviour changes here. |\n| `browser/additions/camoucfg/` | The C++ config layer. `MaskConfig.hpp` reads `CAMOU_CONFIG`, which the patches consult. |\n| `browser/additions/juggler/` | Camoufox's Juggler, Playwright's Firefox protocol. The page agent runs in an isolated world. `input/` holds `MouseDispatch.js` (every synthesized mouse event) and `HumanDelay.js`; the browser adds no humanization of its own ([`docs/humanize.md`](docs/humanize.md)). |\n| `browser/settings/` | `camoufox.cfg` (prefs), `properties.json` (every config key and its type; a key the browser stops reading is marked `removed`, never deleted). |\n| `browser/scripts/` | `patch.py` applies patches and writes the mozconfig; `copy-additions.sh`, `package.py`, `install-deps.sh`, font tooling. |\n| `browser/assets/` | Mozconfigs, README images. |\n| `browser/bundle/` | The per-OS `fontconfig/` files and `FONTS-README.txt`. The fonts are a release asset (`make fonts-extract`), pinned by `browser/scripts/data/font-bundle.json`. |\n| `browser/tests/` | Browser test suites (below): `build-tester/`, `native/`, `service/`, `playwright/`. |\n| `browser/INTERFACE` | The launch interface this build speaks. A driver accepts a range of it ([`ci/README.md`](ci/README.md#the-driver)). |\n| `pyproject.toml`, `camoufox/`, `camoufox_pin/`, `npm/` | The `camoufox` release wrapper on PyPI and npm: camoucore's launcher (`camoucore.camoufox`) under the `camoufox` name, one alias stub per module, an exact `camoucore` pin, and the browser pin that `release.yml` stamps. MIT (`camoufox/LICENSE`, `npm/LICENSE`). No launcher code: `ci/check_no_driver.py` fails a PR that adds any, and `ci/check_wrapper.py` checks an install against camoucore ([`ci/README.md`](ci/README.md#the-driver)). |\n| `ci/` | The test pipeline (below). `ci/tribal-rules.yml` holds the settled decisions. |\n| `docs/` | Design notes and maintenance guides. |\n\n## Building\n\nThe build runs on **Linux**. Windows and macOS binaries are cross-compiled from\nit. `mach` needs Python 3.11 or newer.\n\n```bash\ncd browser\nmake dir                       # fetch Firefox, copy additions, apply every patch\nmake bootstrap                 # one time: scripts/install-deps.sh + mach bootstrap\nmake build                     # ./mach build\nmake run                       # run the build (wipes ~/.camoufox)\nmake package-linux arch=x86_64 # or package-macos / package-windows\npython3 multibuild.py --target linux windows macos --arch x86_64 arm64\npython3 multibuild.py --target windows macos --arch x86_64 --preflight  # compile what the patches touch, in minutes\n```\n\nA pull request builds Linux x86_64 only. CI preflights the other release\ntargets, and `--preflight` does the same locally for a patch with code for\nanother OS or CPU.\n\nEvery build, a local one included, is optimized as stock is\n([`builds-are-optimized-like-stock`](ci/tribal-rules.yml)): with the PGO\nprofile Mozilla trained for the same Firefox, cross-language LTO (full on\nx86_64 Linux and Windows, thin elsewhere) and Rust SIMD, from\n`browser/assets/base.mozconfig`. `make dir` installs the Rust release Mozilla\nbuilds the tree with and fetches the profile pinned in\n`browser/scripts/data/pgo-profiles.json`; after bumping `upstream.sh`, run\n`python3 scripts/pgo.py pin` and `python3 scripts/remote_settings.py pin` (the\npage-visible lists, bundled so the browser never polls for them). Install `ccache`. It caches compiles but not the\nLTO link, so an incremental build still relinks libxul across C++ and Rust.\n\n## Changing a patch\n\nNever hand-edit a `.patch` file. Edit the tree, then write the diff, from\n`browser/`:\n\n```bash\nmake dir && make first-checkpoint          # a new patch: checkpoint, edit, then\nmake diff > patches/my-change.patch        # (git add -N new files first)\n\nmake dir && make workspace ./patches/x.patch   # an existing patch: edit, then\nmake diff > patches/x.patch\n```\n\n`make patch` and `make unpatch` apply or reverse one patch. `make revert` resets\nthe tree to unpatched Firefox. Every make target is described in\n[`docs/patch-upgrading-guide.md`](docs/patch-upgrading-guide.md#the-source-tree-and-its-make-targets),\nwhich also covers porting patches to a new Firefox and porting Playwright. Keep\nthe `Makefile` diff minimal: host dependencies belong in\n`browser/scripts/install-deps.sh`.\n\n## Testing\n\n`ci/` is the whole pipeline. It runs the same way locally and on a pull request\n([`ci/README.md`](ci/README.md), which lists every runner). Branch protection\nrequires one check, **`All tests passed`**. Run the suite that covers your\nchange while you work:\n\n| You changed | Run |\n|---|---|\n| Patches, C++, Juggler | `python3 -m ci.run_build_tester --binary <camoufox-bin>` (the anti-detect suite) and `python3 -m ci.run_patch_guards --binary <camoufox-bin>` (one guard per shipped behaviour, in three groups: `--group spoofing|automation|parity`) |\n| Automation behaviour | `make -C browser tests`, the upstream Playwright suite with `ci/skiplist.yml` applied |\n| `ci/` itself | `python3 -m pytest ci/tests -q` |\n\n- **`browser/tests/playwright/` is not a fork of Playwright's tests.** It holds\n  only `patches/` and `camoufox/`. A deliberate difference from upstream goes\n  in `ci/skiplist.yml`, with its reason.\n- **Tests against an unpackaged build** need `make -C browser stage-fonts` first.\n  Without it the browser has no content fonts.\n- **The stealth grade** (`ci/run_sundial.py`) reports a letter and a count, never\n  the individual vectors.\n\n---\n\n# Using Camoufox\n\nThe drivers are the `camoufox` packages on PyPI and npm (`pip install\n\"camoufox[geoip]\"`, `npm i camoufox`), the launcher in the `camoucore`\npackage under the `camoufox` name. Its source, issues and docs, the\nfull reference for every launch option, the CLI and examples, are in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Every\nconfig key and its type is in\n[`browser/settings/properties.json`](browser/settings/properties.json). Keep\nthis section in step with the launcher options.\n\n## Public API\n\n| Python | TypeScript | Returns |\n|---|---|---|\n| `camoufox.sync_api.Camoufox(**opts)` (context manager) | `Camoufox(opts)` | `Browser`, or `BrowserContext` with `persistent_context` |\n| `camoufox.async_api.AsyncCamoufox(**opts)` (async context manager) | `AsyncCamoufox(opts)` (alias of `Camoufox`) | same |\n| `camoufox.sync_api.NewBrowser(playwright, **opts)` | `NewBrowser(firefox, opts)` | same, on your own Playwright instance |\n| `camoufox.async_api.AsyncNewBrowser(playwright, **opts)` | `AsyncNewBrowser` (alias) | same |\n| `camoufox.sync_api.NewContext(browser, **kw)` | `NewContext(browser, opts)` | `BrowserContext` with its own identity |\n| `camoufox.async_api.AsyncNewContext(browser, **kw)` | `AsyncNewContext` (alias) | same |\n| `camoufox.launch_options(**opts)` | `launchOptions(opts)` | kwargs for `firefox.launch()` (TS: camelCase keys) |\n| `camoufox.server.launch_server(**opts)` | `launchServer(opts)` | Python blocks and prints the ws endpoint; TS returns a `BrowserServer` |\n| `camoufox.DefaultAddons.UBO` | `\"UBO\"` | default addon id for `exclude_addons` |\n| `camoufox.fingerprints.Screen(max_width=, max_height=, min_width=, min_height=)` | `Screen({ maxWidth, ... })` or a plain object | bound for `screen` |\n\n## Pitfalls\n\n- **Do not set identity values by hand.** Do not pass Playwright's `user_agent`, or `navigator.*`, `headers.User-Agent`, `screen.*`, `window.*`, `timezone` or `geolocation:*` in `config`. The identity is drawn as a whole; overriding one value leaves the rest describing a different machine. Use `os`, `screen`, `window`, `locale` and `geoip` instead. Manual config keys print a `LeakWarning`. The coherence checks never replace a key the caller set: one that contradicts the rest of the identity (a Mac at colorDepth 24, a macOS devicePixelRatio of 1.5) is kept, with a second `LeakWarning` that `i_know_what_im_doing` does not silence. Drawn values are repaired; every macOS identity reports colorDepth 30.\n- **Use `geoip=True` with a proxy.** Without it the timezone and locale are the identity's, not the proxy's, and a warning is printed.\n- **`page.evaluate` is isolated.** It cannot read globals the page defined. Use `main_world_eval=True` and prefix the script with `mw:`. Without the option, a `mw:` evaluate fails with \"Main world evaluation is disabled\". `mw:` cannot return a handle (`evaluate_handle`).\n- **Leave the viewport alone.** When the window size is spoofed, new pages default to `no_viewport=True`; forcing a `viewport` asks the window to resize to something the identity does not claim.\n- **The OS counts clicks and repeats keys.** A press's `detail` follows the identity's OS, not `click_count`: presses count up only when quick and in place (`dblclick` is). A key held with `keyboard.down` repeats until `keyboard.up`, with that OS's delay and interval ([docs/input-dispatch.md](docs/input-dispatch.md#click-count)).\n- **`is_mobile` is ignored** (with a warning). Camoufox has desktop identities only.\n- **Persistent contexts** need `persistent_context=True` and `user_data_dir`, and cannot be served by `launch_server`.\n- **`headless=\"virtual\"`** needs Linux, `Xvfb` and `setpriv` from util-linux (`CannotFindXvfb`, `VirtualDisplayNotSupported` otherwise). Xvfb has no GPU, so canvas and WebGL render in software and the identity reports `llvmpipe`.\n- **`headless=\"virtual-gpu\"`** renders on one GPU, named by `gpu=` or `CAMOUFOX_GPU` (a PCI address is the stable choice); several GPUs and no selector raise `AmbiguousGpuSelection`. Without root it needs Xorg.wrap allowed to start Xorg as root for any user, and the card's config in `/etc/X11`; `python -m camoufox gpu-setup <gpu> | sudo sh` does both, and every failure that setup would fix ends with that command. A browser that does not render on the card raises `GpuSoftwareFallback` (`require_gpu=False` warns). Every error is a `VirtualDisplayError`. `gpu` and `require_gpu` are not `launch_options()` arguments.\n- **`os` values are lowercase** `windows`, `macos`, `linux`; anything else raises `InvalidOS`.\n- **`geoip` in Python needs the extra**: `pip install \"camoufox[geoip]\"`, else `NotInstalledGeoIPExtra`.\n- **`InvalidIP`** is raised when the public-IP or proxy exit-IP lookup fails, or when `webrtc_ip` is not a valid IPv4/IPv6 address. Pass `webrtc_ip`, `timezone_id`, `locale` and `geolocation` to `NewContext` to skip the lookup.\n- **`InvalidProxy`** means the proxy `server` string could not be parsed.\n- **`UnknownIPLocation`**: the IP is not in the GeoIP database; pass `locale` and set coordinates another way.\n- **Version ceilings:** Playwright below 1.63; Node.js 22.15 or newer.\n- **Each package release is paired with one browser build.** `camoufox set` overrides it (with a warning at launch), the `browser` option overrides it for one launch, and `camoufox set --release` restores it.\n- **`browser` and `executable_path` are exclusive**: passing `browser` with `executable_path`, or while `CAMOUFOX_EXECUTABLE_PATH` is set, raises `ValueError`.\n- **Canvas is not noised on the host's OS**: the identity claims the host's GPU or software renderer (`llvmpipe` on Linux), and the canvas hash is stable per machine. An identity on another OS, or claiming a GPU that is not the host's (`webgl_config`, a preset's GPU, or a host GPU fpgen never recorded), gets `privacy.resistFingerprinting`'s random canvas readback (as in LibreWolf), with a `LeakWarning`; `canvas_noise=True`/`False` forces it. It is per browser: contexts of a browser without it claim the host's OS and GPU, and `NewContext` raises for another OS or GPU.\n- **A Windows launch on another host is Windows for every context.** The Windows CRT math, the Windows keyboard (GTK only: on a macOS host just the editor caret style), the behaviour prefs and the scrollbars (docs/HOST-PARITY.md) are prefs and launch config, so they belong to the browser, not the context. A `macos` or `linux` context on that browser has them too; a Windows context on a browser launched as macOS or Linux has the host's. `NewContext` does not refuse either, because a launch without `os` draws its OS, and the refusal would depend on that draw. To mix OSes, pass `os` at launch for the one whose behaviour matters, or use one browser per OS.\n","isInternal":false,"tokens":4960,"sizeBytes":19398},{"name":"CLAUDE.md","path":"CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/daijro/camoufox/HEAD/CLAUDE.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"@AGENTS.md\n","isInternal":false,"tokens":5,"sizeBytes":11}],"systemPromptSnippet":"<yakaai_skills repo=\"daijro/camoufox\">\n<!-- File: AGENTS.md (Tokens: ~4960 | Category: root-instruction) -->\n# AGENTS.md\n\nInstructions for any coding agent working in this repository or writing code\nagainst Camoufox: Claude Code, Codex, Cursor, Copilot, Gemini or anything else.\n`CLAUDE.md` and `GEMINI.md` only import this file, and `.aider.conf.yml` reads\nit, so there is one set of rules. Edit them here.\n\n---\n\n## Before you touch anything\n\n1. **This repository is public.** The professionalism rules below govern every\n   line, commit message, PR title and comment you write.\n2. **Read [`ci/tribal-rules.yml`](ci/tribal-rules.yml).** It lists the decisions\n   this repo has already made, each with its evidence. Many are checked by\n   `browser/tests/native/test_tribal_rules.py`. Do not reopen one without new\n   evidence. When a new decision is argued and settled, add it there with its\n   citation.\n3. **Branch off `main`. Never commit or push to `main`.** Every change is a pull\n   request tied to a GitHub issue ([`CONTRIBUTING.md`](CONTRIBUTING.md)).\n\n## Before you write a function\n\nSearch for an existing implementation first: `ci/`, `browser/scripts/` and\n`browser/additions/`, and for launcher code the drivers in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Launcher changes\n(Python and TypeScript, fingerprints, the CLI, the MCP server) are made there,\nnever here: this repository holds the browser patches, the build and the\nrelease wrapper. If something close\nexists, extend it rather than forking it. Duplicated logic is a serious defect\nhere, because the copies drift and a fingerprint built from two drifting copies\nis detectable.\n\n## Professionalism\n\nA public repository is a finished product. People judge the project by what\nis in it, and they will not ask what a file was for.\n\n- **No garbage.** No scratch files, diagnostic scripts, saved test output,\n  logs, debug logging, commented-out code, dead code, placeholder text, stub\n  docs, or `TODO`s left as notes to self.\n- **Nothing private reaches this repo.** That includes proprietary results,\n  private repo names, and per-vector stealth detail. `ci/run_sundial.py` reports\n  a grade and a count; the vectors never leave that module.\n- Write commits and PR titles for a stranger reading them in a year.\n- **Documentation is never stale.** Update the README, `docs/` and the package\n  READMEs in the same pull request as the code that changed them, never\n  \"later\". Every snippet must run as written.\n\n## Code\n\n- **Less code.** More code is a cost, not an achievement. Make minimal, general\n  changes, and delete dead code when you find it.\n- **No band-aids.** Fix the main flow. A hard-coded value or a special case at\n  the call site is a bug relocated, not fixed.\n- **Fallbacks are a last resort.** They turn a loud failure into a silent wrong\n  answer, and in an anti-detect browser a silent wrong answer is a fingerprint.\n  Fail loudly instead.\n- **Check real data before inventing a value.** Every spoofed value must be\n  something a real device reports. Take it from the recorded distributions\n  (fpgen, the driver's data files in camoucore), not from memory.\n- **Read the provider's docs** before writing against a third-party API or a\n  Firefox internal. Never infer an endpoint, pref or field from memory.\n- **Comments say why, in a sentence or two.** Simple code needs none. A longer\n  explanation is a decision: put it in `ci/tribal-rules.yml` or `docs/`.\n\n## Tests\n\n- **Run the failing test, not the whole suite.** CI runs the full pipeline on\n  every pull request.\n- **Write test output to a log file and grep the file.** Piping a run straight\n  into `grep` throws away output you will need. Delete the log afterwards.\n- **Every bug gets a regression test, in this order:** reproduce it with a test\n  and confirm the test fails, fix the bug, confirm the test passes, then land\n  both.\n- **No flakes.** An intermittent failure means something is non-deterministic.\n  Fix that behaviour. Never retry, loosen a threshold or skip the test to get\n  green. A timing check measures what the browser did, never the driver's\n  sleep: the browser sees a `wait_for_timeout(n)` as n ms plus the driver's\n  and its own latency, which is unbounded on a loaded runner. Bound such a\n  quantity on one side (at least what n ms allows), and check order with\n  event order (nothing after the keyup), not with counts. A guard that waits\n  for something to be freed or settle polls to a deadline instead of\n  sleeping a fixed time. A guard that fails only on a loaded runner may be\n  showing a real difference from Firefox under load (driven key repeats\n  burst where Firefox skips them): compare stock Firefox under the same load\n  before deciding the check is wrong. Before trusting a fix, run the guard\n  many times on the CI runners, and break the code it guards to see it fail.\n- **A missing prerequisite fails in CI; it never passes as a skip.** A skip\n  reads as green, so a job that forgot to install something passes having\n  tested nothing.\n- **When local and CI disagree, name the mechanism and fix it in the repo.**\n  Typical causes are git-ignored inputs, skipped prerequisites and cold-cache\n  races. A fresh clone is a sanity check, not a fix.\n- **Never write a test just to pass, or code just to pass a test.**\n\n## Security\n\n- **Never commit a credential.** That covers code, config, fixtures, logs and\n  commit messages. CI secrets live in GitHub Actions secrets.\n- **Least privilege** for workflows and tokens. Grant `permissions:` per job,\n  and only what that job needs.\n- **Adding a dependency is a decision.** Say why in the pull request, and commit\n  the lockfile.\n\n## Working with the maintainers\n\n- Say when a direction is wrong, before starting, and give the reason.\n- Review your own diff the way a strict senior reviewer would. You are biased\n  toward what you just wrote.\n- Explain plainly and briefly.\n\n## Parallel work\n\n- **Separate pull requests:** one agent per task, each in its own git worktree,\n  running at the same time.\n- **One pull request with independent slow parts:** use subagents in worktrees.\n  Merge each part into your branch as it finishes, then delete the worktrees.\n- **Shared files or an ordering requirement:** use one agent.\n\n---\n\n# Repository\n\n## What this is\n\nCamoufox is an anti-detect Firefox for web scraping and automation. This repo\nis **not the Firefox source**. It is a build system that fetches upstream\nFirefox, applies `browser/patches/` and copies in `browser/additions/`, and\nproduces the browser. Fingerprint spoofing happens in C++ and in Juggler, not in\ninjected JavaScript, so a page cannot see it.\n\n`browser/upstream.sh` pins `version` and `release`. `browser/Makefile` sources\nand exports it, so every script sees them. Run `make` from `browser/`. The\nFirefox tree lives in `browser/camoufox-<version>-<release>/`. It is generated:\npersist a change there as a patch, never as an edit to that tree.\n\n| Path | What it is |\n|---|---|\n| `browser/` | The browser build: `Makefile`, `upstream.sh`, `multibuild.py`, `Dockerfile`, and the directories below. |\n| `browser/patches/` | Diffs applied to Firefox: one per behaviour at the top level, plus `playwright/`, `librewolf/` and `ghostery/`. Browser behaviour changes here. |\n| `browser/additions/camoucfg/` | The C++ config layer. `MaskConfig.hpp` reads `CAMOU_CONFIG`, which the patches consult. |\n| `browser/additions/juggler/` | Camoufox's Juggler, Playwright's Firefox protocol. The page agent runs in an isolated world. `input/` holds `MouseDispatch.js` (every synthesized mouse event) and `HumanDelay.js`; the browser adds no humanization of its own ([`docs/humanize.md`](docs/humanize.md)). |\n| `browser/settings/` | `camoufox.cfg` (prefs), `properties.json` (every config key and its type; a key the browser stops reading is marked `removed`, never deleted). |\n| `browser/scripts/` | `patch.py` applies patches and writes the mozconfig; `copy-additions.sh`, `package.py`, `install-deps.sh`, font tooling. |\n| `browser/assets/` | Mozconfigs, README images. |\n| `browser/bundle/` | The per-OS `fontconfig/` files and `FONTS-README.txt`. The fonts are a release asset (`make fonts-extract`), pinned by `browser/scripts/data/font-bundle.json`. |\n| `browser/tests/` | Browser test suites (below): `build-tester/`, `native/`, `service/`, `playwright/`. |\n| `browser/INTERFACE` | The launch interface this build speaks. A driver accepts a range of it ([`ci/README.md`](ci/README.md#the-driver)). |\n| `pyproject.toml`, `camoufox/`, `camoufox_pin/`, `npm/` | The `camoufox` release wrapper on PyPI and npm: camoucore's launcher (`camoucore.camoufox`) under the `camoufox` name, one alias stub per module, an exact `camoucore` pin, and the browser pin that `release.yml` stamps. MIT (`camoufox/LICENSE`, `npm/LICENSE`). No launcher code: `ci/check_no_driver.py` fails a PR that adds any, and `ci/check_wrapper.py` checks an install against camoucore ([`ci/README.md`](ci/README.md#the-driver)). |\n| `ci/` | The test pipeline (below). `ci/tribal-rules.yml` holds the settled decisions. |\n| `docs/` | Design notes and maintenance guides. |\n\n## Building\n\nThe build runs on **Linux**. Windows and macOS binaries are cross-compiled from\nit. `mach` needs Python 3.11 or newer.\n\n```bash\ncd browser\nmake dir                       # fetch Firefox, copy additions, apply every patch\nmake bootstrap                 # one time: scripts/install-deps.sh + mach bootstrap\nmake build                     # ./mach build\nmake run                       # run the build (wipes ~/.camoufox)\nmake package-linux arch=x86_64 # or package-macos / package-windows\npython3 multibuild.py --target linux windows macos --arch x86_64 arm64\npython3 multibuild.py --target windows macos --arch x86_64 --preflight  # compile what the patches touch, in minutes\n```\n\nA pull request builds Linux x86_64 only. CI preflights the other release\ntargets, and `--preflight` does the same locally for a patch with code for\nanother OS or CPU.\n\nEvery build, a local one included, is optimized as stock is\n([`builds-are-optimized-like-stock`](ci/tribal-rules.yml)): with the PGO\nprofile Mozilla trained for the same Firefox, cross-language LTO (full on\nx86_64 Linux and Windows, thin elsewhere) and Rust SIMD, from\n`browser/assets/base.mozconfig`. `make dir` installs the Rust release Mozilla\nbuilds the tree with and fetches the profile pinned in\n`browser/scripts/data/pgo-profiles.json`; after bumping `upstream.sh`, run\n`python3 scripts/pgo.py pin` and `python3 scripts/remote_settings.py pin` (the\npage-visible lists, bundled so the browser never polls for them). Install `ccache`. It caches compiles but not the\nLTO link, so an incremental build still relinks libxul across C++ and Rust.\n\n## Changing a patch\n\nNever hand-edit a `.patch` file. Edit the tree, then write the diff, from\n`browser/`:\n\n```bash\nmake dir && make first-checkpoint          # a new patch: checkpoint, edit, then\nmake diff > patches/my-change.patch        # (git add -N new files first)\n\nmake dir && make workspace ./patches/x.patch   # an existing patch: edit, then\nmake diff > patches/x.patch\n```\n\n`make patch` and `make unpatch` apply or reverse one patch. `make revert` resets\nthe tree to unpatched Firefox. Every make target is described in\n[`docs/patch-upgrading-guide.md`](docs/patch-upgrading-guide.md#the-source-tree-and-its-make-targets),\nwhich also covers porting patches to a new Firefox and porting Playwright. Keep\nthe `Makefile` diff minimal: host dependencies belong in\n`browser/scripts/install-deps.sh`.\n\n## Testing\n\n`ci/` is the whole pipeline. It runs the same way locally and on a pull request\n([`ci/README.md`](ci/README.md), which lists every runner). Branch protection\nrequires one check, **`All tests passed`**. Run the suite that covers your\nchange while you work:\n\n| You changed | Run |\n|---|---|\n| Patches, C++, Juggler | `python3 -m ci.run_build_tester --binary <camoufox-bin>` (the anti-detect suite) and `python3 -m ci.run_patch_guards --binary <camoufox-bin>` (one guard per shipped behaviour, in three groups: `--group spoofing|automation|parity`) |\n| Automation behaviour | `make -C browser tests`, the upstream Playwright suite with `ci/skiplist.yml` applied |\n| `ci/` itself | `python3 -m pytest ci/tests -q` |\n\n- **`browser/tests/playwright/` is not a fork of Playwright's tests.** It holds\n  only `patches/` and `camoufox/`. A deliberate difference from upstream goes\n  in `ci/skiplist.yml`, with its reason.\n- **Tests against an unpackaged build** need `make -C browser stage-fonts` first.\n  Without it the browser has no content fonts.\n- **The stealth grade** (`ci/run_sundial.py`) reports a letter and a count, never\n  the individual vectors.\n\n---\n\n# Using Camoufox\n\nThe drivers are the `camoufox` packages on PyPI and npm (`pip install\n\"camoufox[geoip]\"`, `npm i camoufox`), the launcher in the `camoucore`\npackage under the `camoufox` name. Its source, issues and docs, the\nfull reference for every launch option, the CLI and examples, are in\n[CamouBrowser/camoucore](https://github.com/CamouBrowser/camoucore). Every\nconfig key and its type is in\n[`browser/settings/properties.json`](browser/settings/properties.json). Keep\nthis section in step with the launcher options.\n\n## Public API\n\n| Python | TypeScript | Returns |\n|---|---|---|\n| `camoufox.sync_api.Camoufox(**opts)` (context manager) | `Camoufox(opts)` | `Browser`, or `BrowserContext` with `persistent_context` |\n| `camoufox.async_api.AsyncCamoufox(**opts)` (async context manager) | `AsyncCamoufox(opts)` (alias of `Camoufox`) | same |\n| `camoufox.sync_api.NewBrowser(playwright, **opts)` | `NewBrowser(firefox, opts)` | same, on your own Playwright instance |\n| `camoufox.async_api.AsyncNewBrowser(playwright, **opts)` | `AsyncNewBrowser` (alias) | same |\n| `camoufox.sync_api.NewContext(browser, **kw)` | `NewContext(browser, opts)` | `BrowserContext` with its own identity |\n| `camoufox.async_api.AsyncNewContext(browser, **kw)` | `AsyncNewContext` (alias) | same |\n| `camoufox.launch_options(**opts)` | `launchOptions(opts)` | kwargs for `firefox.launch()` (TS: camelCase keys) |\n| `camoufox.server.launch_server(**opts)` | `launchServer(opts)` | Python blocks and prints the ws endpoint; TS returns a `BrowserServer` |\n| `camoufox.DefaultAddons.UBO` | `\"UBO\"` | default addon id for `exclude_addons` |\n| `camoufox.fingerprints.Screen(max_width=, max_height=, min_width=, min_height=)` | `Screen({ maxWidth, ... })` or a plain object | bound for `screen` |\n\n## Pitfalls\n\n- **Do not set identity values by hand.** Do not pass Playwright's `user_agent`, or `navigator.*`, `headers.User-Agent`, `screen.*`, `window.*`, `timezone` or `geolocation:*` in `config`. The identity is drawn as a whole; overriding one value leaves the rest describing a different machine. Use `os`, `screen`, `window`, `locale` and `geoip` instead. Manual config keys print a `LeakWarning`. The coherence checks never replace a key the caller set: one that contradicts the rest of the identity (a Mac at colorDepth 24, a macOS devicePixelRatio of 1.5) is kept, with a second `LeakWarning` that `i_know_what_im_doing` does not silence. Drawn values are repaired; every macOS identity reports colorDepth 30.\n- **Use `geoip=True` with a proxy.** Without it the timezone and locale are the identity's, not the proxy's, and a warning is printed.\n- **`page.evaluate` is isolated.** It cannot read globals the page defined. Use `main_world_eval=True` and prefix the script with `mw:`. Without the option, a `mw:` evaluate fails with \"Main world evaluation is disabled\". `mw:` cannot return a handle (`evaluate_handle`).\n- **Leave the viewport alone.** When the window size is spoofed, new pages default to `no_viewport=True`; forcing a `viewport` asks the window to resize to something the identity does not claim.\n- **The OS counts clicks and repeats keys.** A press's `detail` follows the identity's OS, not `click_count`: presses count up only when quick and in place (`dblclick` is). A key held with `keyboard.down` repeats until `keyboard.up`, with that OS's delay and interval ([docs/input-dispatch.md](docs/input-dispatch.md#click-count)).\n- **`is_mobile` is ignored** (with a warning). Camoufox has desktop identities only.\n- **Persistent contexts** need `persistent_context=True` and `user_data_dir`, and cannot be served by `launch_server`.\n- **`headless=\"virtual\"`** needs Linux, `Xvfb` and `setpriv` from util-linux (`CannotFindXvfb`, `VirtualDisplayNotSupported` otherwise). Xvfb has no GPU, so canvas and WebGL render in software and the identity reports `llvmpipe`.\n- **`headless=\"virtual-gpu\"`** renders on one GPU, named by `gpu=` or `CAMOUFOX_GPU` (a PCI address is the stable choice); several GPUs and no selector raise `AmbiguousGpuSelection`. Without root it needs Xorg.wrap allowed to start Xorg as root for any user, and the card's config in `/etc/X11`; `python -m camoufox gpu-setup <gpu> | sudo sh` does both, and every failure that setup would fix ends with that command. A browser that does not render on the card raises `GpuSoftwareFallback` (`require_gpu=False` warns). Every error is a `VirtualDisplayError`. `gpu` and `require_gpu` are not `launch_options()` arguments.\n- **`os` values are lowercase** `windows`, `macos`, `linux`; anything else raises `InvalidOS`.\n- **`geoip` in Python needs the extra**: `pip install \"camoufox[geoip]\"`, else `NotInstalledGeoIPExtra`.\n- **`InvalidIP`** is raised when the public-IP or proxy exit-IP lookup fails, or when `webrtc_ip` is not a valid IPv4/IPv6 address. Pass `webrtc_ip`, `timezone_id`, `locale` and `geolocation` to `NewContext` to skip the lookup.\n- **`InvalidProxy`** means the proxy `server` string could not be parsed.\n- **`UnknownIPLocation`**: the IP is not in the GeoIP database; pass `locale` and set coordinates another way.\n- **Version ceilings:** Playwright below 1.63; Node.js 22.15 or newer.\n- **Each package release is paired with one browser build.** `camoufox set` overrides it (with a warning at launch), the `browser` option overrides it for one launch, and `camoufox set --release` restores it.\n- **`browser` and `executable_path` are exclusive**: passing `browser` with `executable_path`, or while `CAMOUFOX_EXECUTABLE_PATH` is set, raises `ValueError`.\n- **Canvas is not noised on the host's OS**: the identity claims the host's GPU or software renderer (`llvmpipe` on Linux), and the canvas hash is stable per machine. An identity on another OS, or claiming a GPU that is not the host's (`webgl_config`, a preset's GPU, or a host GPU fpgen never recorded), gets `privacy.resistFingerprinting`'s random canvas readback (as in LibreWolf), with a `LeakWarning`; `canvas_noise=True`/`False` forces it. It is per browser: contexts of a browser without it claim the host's OS and GPU, and `NewContext` raises for another OS or GPU.\n- **A Windows launch on another host is Windows for every context.** The Windows CRT math, the Windows keyboard (GTK only: on a macOS host just the editor caret style), the behaviour prefs and the scrollbars (docs/HOST-PARITY.md) are prefs and launch config, so they belong to the browser, not the context. A `macos` or `linux` context on that browser has them too; a Windows context on a browser launched as macOS or Linux has the host's. `NewContext` does not refuse either, because a launch without `os` draws its OS, and the refusal would depend on that draw. To mix OSes, pass `os` at launch for the one whose behaviour matters, or use one browser per OS.\n\n<!-- File: CLAUDE.md (Tokens: ~5 | Category: claude-rule) -->\n@AGENTS.md\n</yakaai_skills>"}