What is camofox-browser
Camofox Browser is an open-source AI Agent anti-detection browser server built on Camoufox (a Firefox modified at the C++ level for fingerprint spoofing). It provides AI with structured webpage snapshots via a REST API (over 90% size reduction), generating stable element references (such as e1, e2) for AI to interact with directly. Camofox Browser has built-in C++-level fingerprint spoofing, capable of bypassing mainstream anti-scraping verification such as Cloudflare; it supports Cookie import, session persistence, and 15+ search macros.
Main features of camofox-browse
-
C++-level anti-detection browsing: Built on Camoufox, a modified Firefox, it spoofs fingerprint information such as hardware concurrency, WebGL renderer, AudioContext, screen geometry, and WebRTC at the C++ implementation layer, which cannot be seen through at the JavaScript layer.
-
Structured webpage snapshots: Distills raw HTML into a numbered, labeled accessibility snapshot (over 90% size reduction), allowing AI to interact with the page directly through
e1、e2and other stable references. -
Cookie import and session persistence: Supports importing Netscape-format Cookie files for login-free access; user session Cookies and localStorage are automatically persisted locally, maintaining login status after restart.
-
Search macro shortcuts: Built-in 15+ search macros for mainstream platforms (such as
@google_search、@reddit_search、@youtube_search), reaching the target page with a single command; the Reddit macro returns JSON data directly. -
Automatic proxy and GeoIP matching: Supports residential proxies and Backconnect rotating proxies, automatically setting the browser timezone, language, and geographic coordinates based on the proxy exit IP to maintain fingerprint consistency.
-
YouTube subtitle extraction: Integrates yt-dlp to quickly extract subtitles from any YouTube video, no API Key required, with multi-language filtering support.
-
VNC visual interactive login: Manually complete interactive login on complex websites in the browser via noVNC, and export the storage state for reuse by subsequent Agent automation.
-
Session tracing and debugging: Supports enabling Playwright tracing per session, generating
.zipfiles containing screenshots, DOM snapshots, and network requests for later troubleshooting. -
Lightweight deployment and elastic scaling: Memory usage is about 40MB when idle, supports one-click deployment on Docker, Fly.io, and Railway, with lazy loading of the browser engine + automatic shutdown when idle.
Technical principles of camofox-browse
-
C++-level fingerprint spoofing: Camoufox modifies at the Firefox source code level
navigator.hardwareConcurrency, WebGL render strings, AudioContext fingerprints, screen resolution, and WebRTC and other attributes, so anti-scraping systems receive spoofed parameters before JS execution. -
Accessibility Tree snapshots: Uses Playwright's accessibility tree to extract the page's semantic structure, generating a textual snapshot with stable references to pass to the LLM instead of the raw DOM.
-
Playwright browser context isolation: Each user corresponds to an independent
BrowserContext, with Cookies, localStorage, and cache fully isolated to avoid session cross-talk. -
Lazy loading and idle recycling: The Camoufox engine (about 300MB) is started on the first request, and the process automatically shuts down after 5 minutes with no active sessions, reducing resident resource usage.
-
Structured JSON logs: All request and response outputs are single-line JSON objects, including
reqIdfor log aggregation and traceability in distributed environments.
How to use camofox-browse
-
Install dependencies: Run
npm install @askjo/camofox-browser. On first installation, it will automatically download the approximately 300MB Camoufox engine. -
Local startup: After cloning the repository, run
npm install && npm start. The service listens by default onhttp://localhost:9377。 -
Configure access key (production environment): Generate a 32-character hexadecimal key and set the environment variable
CAMOFOX_ACCESS_KEY. All requests must carryAuthorization: Bearer <key>。 -
Import cookies to achieve login-free access: Place the Netscape-format cookie file exported from the browser into the
~/.camofox/cookies/directory, and use the API or the OpenClaw plugin to call the import tool to inject the session. -
Create a tab and get a snapshot: Send a POST request to
/tabsto create a tab, then call/tabs/:id/snapshotto get ae1、e2referenced structured page summary. -
Perform page interactions: Through
/tabs/:id/clickor/tabs/:id/type, pass in the element reference number and text content to implement click and input operations. -
Navigate using search macros: Call
/tabs/:id/navigateand pass in"macro": "@google_search"and"query": "关键词"to directly get the search results page. -
Docker deployment: In the project root directory, execute
make up. The Makefile will automatically detect the CPU architecture and pre-download the binary files, completing the build and startup in about 30 seconds.
Core advantages of camofox-browse
-
Bypass mainstream anti-scraping and CAPTCHAs: Because fingerprints are forged at the C++ layer, it can stably pass bot detection on platforms such as Google and Cloudflare, avoiding frequent triggering of human verification.
-
Extremely high token efficiency: Structured snapshots reduce the size by more than 90% compared with raw HTML, greatly reducing LLM context window usage and API call costs.
-
Stable and reliable element references: After minor page layout adjustments, references such as
e1、e2can still remain valid through the accessibility tree, reducing the probability of Agent operation failures due to DOM changes. -
Out-of-the-box search capabilities: 15+ search macros cover mainstream information sources, so the Agent does not need to construct search URLs and parse pages itself. Sites such as Reddit directly return structured JSON.
-
Production-grade security model: Cookie import is disabled by default (requires
CAMOFOX_API_KEY), supports global Access Key authentication, path traversal protection, runtime injection of all sensitive data, and zero hard-coded keys.
Project address of camofox-browse
- GitHub repository:https://github.com/jo-inc/camofox-browser
Comparison of camofox-browse with similar competitors
| Dimension | Camofox Browser | Puppeteer / Playwright | Selenium WebDriver |
|---|---|---|---|
| Anti-detection capability | C++ layer fingerprint forgery, natively bypasses Cloudflare and Google verification | Requires additional installation of a stealth plugin, and the plugin itself may become a new fingerprint | No native anti-detection; needs to work with an external fingerprint browser or proxy pool |
| AI interaction efficiency | Structured accessibility snapshot, size reduced by 90%+, with stable element references | Returns full HTML, requiring self-parsing or screenshots for AI recognition | Returns full HTML, high parsing cost, no native element numbering mechanism |
| Deployment resource usage | About 40MB when idle, lazy loading + automatic shutdown | Persistent Chromium process, high memory usage | Persistent browser instance, high resource overhead |
| Cookie/session management | Built-in Netscape Cookie import, session persistence, and VNC interactive login | Requires manually writing Cookie injection and context management code | Requires manual configuration of profile and Cookie injection |
| Search shortcuts | Built-in search macros for 15+ platforms, Reddit returns JSON directly | No built-in search macros, requires constructing URLs and parsing logic yourself | No built-in search macros |
| Proxy integration | Native support for residential proxies and Backconnect, automatically syncing timezone/language/coordinates | Requires manual proxy parameter configuration, no automatic GeoIP matching | Requires manual proxy configuration, no automatic GeoIP matching |
| Use cases | AI Agent anti-detection browsing, cloud automation, production-grade data collection | Frontend testing, general web automation, crawler development | Traditional end-to-end testing, complex enterprise-grade testing frameworks |
Use cases for camofox-browse
-
AI Agent web automation: Provides a programmable browser backend for LLM-based agents to perform tasks such as data scraping, form filling, and information retrieval.
-
E-commerce and competitor monitoring: Bypasses platform anti-scraping mechanisms to automatically scrape product prices, inventory, and review information, supporting account-level data collection under logged-in sessions.
-
Social media automation: After importing Cookies, automatically operates accounts such as Twitter, LinkedIn, and Instagram to perform content publishing, interaction, and data analysis.
-
Academic and public opinion research: Uses search macros to quickly retrieve information from Google, Wikipedia, and Reddit, and extracts YouTube video subtitles for content analysis.
-
Cloud automated testing: Deployed in VPS or container environments, serving as a headless browser service to support end-to-end testing and web monitoring in CI/CD pipelines.