camofox-browser - Open source AI Agent anti-detection browser
Camofox Browser is an open-source AI Agent anti-detection browser server built on Camoufox (a heavily modified C++ version of Firefox with fingerprinting capabilities). It provides AI with structured webpage snapshots (reduced in size) via a REST API...
What is camofox-browser?
Camofox Browser is an open-source AI Agent anti-detection browser server built on Camoufox (a heavily modified C++ fingerprint version of Firefox). It provides AI with structured webpage snapshots (reduced in size by 90%+) via a REST API, generating stable element references (such as e1, e2) for direct AI interaction. Camofox Browser incorporates C++-level fingerprint forgery, bypassing mainstream anti-scraping verification methods like Cloudflare; it supports cookie import, session persistence, and 15+ search macros.
The main functions of camofox-browse
-
C++ level anti-detection browsing: The underlying implementation is a modified version of Firefox called Camoufox. In the C++ implementation layer, it forges fingerprint information such as hardware concurrency, WebGL renderer, AudioContext, screen geometry, and WebRTC, which cannot be detected by the JavaScript layer.
-
Structured webpage snapshot: Extracting the original HTML into a numbered accessibility snapshot (reducing size by over 90%), AI can directly...
e1,e2Wait for stable references and page interactions. -
Cookie import and session persistence: It supports importing Netscape format cookie files to achieve login-free access. User session cookies and localStorage are automatically persisted to the local machine and the login status is maintained after restart.
-
Search macro shortcuts: Built-in search macros for 15+ mainstream platforms (such as...)
@google_search,@reddit_search,@youtube_searchA single command directly reaches the target page, and the Reddit macro returns JSON data. -
Proxy and GeoIP are automatically matched: It supports residential proxies and Backconnect rotating proxies, and automatically sets the browser's time zone, language, and geographic coordinates based on the proxy's outgoing IP address to maintain fingerprint consistency.
-
YouTube subtitle extraction: Integrates yt-dlp to quickly extract subtitles from any YouTube video without requiring an API key and supports multi-language filtering.
-
VNC Visual Interactive Login: Manually complete interactive login for complex websites in a browser using noVNC, and export the stored state for subsequent automated reuse by the Agent.
-
Session tracing and debugging: Supports enabling Playwright tracking per session, generating screenshots, DOM snapshots, and network requests.
.zipDocuments are available for future review. -
Lightweight deployment and elastic scaling: It uses approximately 40MB of memory when idle, supports one-click deployment with Docker, Fly.io, and Railway, and features lazy loading of the browser engine and automatic shutdown when idle.
The technical principle of camofox-browse
-
C++ layer fingerprint spoofing: Camoufox modifies Firefox source code.
navigator.hardwareConcurrencyProperties such as WebGL rendering strings, AudioContext fingerprints, screen resolution, and WebRTC are forged by anti-scraping systems before the JavaScript is executed. -
Accessibility Tree Snapshot: Playwright's accessibility tree is used to extract the semantic structure of the page, generating a textual snapshot with stable references, which is then passed to the LLM instead of the original DOM.
-
Playwright browser context isolation: Each user corresponds to an independent
BrowserContextCookies, localStorage, and cache are completely isolated to avoid session interference. -
Lazy loading and idle garbage collection: The Camoufox engine (approximately 300MB) is started on the first request, and the process is automatically shut down after 5 minutes of inactive sessions to reduce persistent resource consumption.
-
Structured JSON logs: All requests and responses are output as a single-line JSON object, containing...
reqIdIt facilitates log aggregation and tracing in a distributed environment.
How to use camofox-browse
-
Install dependencies: implement
npm install @askjo/camofox-browserThe first installation will automatically download the Camoufox engine, which is about 300MB. -
Local startup: Run after cloning the repository
npm install && npm startThe service listens by default.http://localhost:9377. -
Configure access keys (production environment): Generate a 32-bit hexadecimal key and set environment variables.
CAMOFOX_ACCESS_KEYAll requests must includeAuthorization: Bearer <key>. -
Importing cookies to achieve login-free access: Place the Netscape format cookie file exported by the browser into
~/.camofox/cookies/The directory allows you to inject sessions by calling the import tool via API or the OpenClaw plugin. -
Create a tab and get a snapshot: Towards
/tabsSend a POST request to create a tab, then call.../tabs/:id/snapshotGet the belte1,e2A summary of the structured pages referenced. -
Perform page interaction: pass
/tabs/:id/clickor/tabs/:id/typePass in the element reference number and text content to enable click and input operations. -
Navigate using search macros: Call
/tabs/:id/navigateAnd transmitted"macro": "@google_search"and"query": "关键词"Directly access the search results page. -
Docker Deployment: Execute in the project root directory
make upThe Makefile will automatically detect the CPU architecture and pre-download the binary files, and the build will start in about 30 seconds.
The core advantages of camofox-browse
-
Bypassing mainstream anti-scraping and CAPTCHA measures: Since the fingerprint is forged at the C++ layer, it can reliably pass bot detection on platforms such as Google and Cloudflare, avoiding frequent triggering of human verification.
-
Tokens are extremely efficient: Structured snapshots reduce the size by more than 90% compared to the original HTML, significantly reducing the LLM context window footprint and API call costs.
-
Element references are stable and reliable: After minor adjustments to the page layout,
e1,e2References can remain valid through the accessibility tree, reducing the probability of the Agent failing to operate due to DOM changes. -
Out-of-the-box search capabilities: 15+ search macros cover mainstream information sources, eliminating the need for an agent to construct search URLs and parse pages; sites like Reddit directly return structured JSON.
-
Production-level safety model: Cookie import is disabled by default (required)
CAMOFOX_API_KEYIt supports global Access Key authentication, path traversal protection, runtime injection of all sensitive data, and zero hard-coded keys.
The project address for camofox-browse
- GitHub repositoryhttps://github.com/jo-inc/camofox-browser
Comparison of similar products to camofox-browse
| Dimension | Camofox Browser | Puppeteer / Playwright | Selenium WebDriver |
|---|---|---|---|
| Anti-detection capability | C++ layer fingerprint forgery, natively bypassing Cloudflare and Google verification. | The stealth plugin needs to be installed separately; the plugin itself may become the new fingerprint. | There is no native anti-detection feature; it requires the use of an external fingerprint browser or proxy pool. |
| AI interaction efficiency | Structured accessibility snapshot, size reduced by 90%+, with stable element references. | To receive the complete HTML, you need to parse it yourself or take a screenshot and send it to the AI for recognition. | Returning to the complete HTML results in high parsing costs and lacks a native element numbering mechanism. |
| Deployment resource consumption | Approximately 40MB of free space, lazy loading + automatic shutdown. | The Chromium process is resident and consumes a lot of memory. | A persistent browser instance consumes a lot of resources. |
| Cookie/Session Management | Built-in Netscape Cookie import, session persistence, and VNC interactive login | Cookie injection and context management code needs to be written manually. | Profile and Cookie injection need to be configured manually. |
| Search shortcuts | Built-in search macros for 15+ platforms; Reddit directly returns JSON. | There are no built-in search macros; you need to construct the URL and parsing logic yourself. | No built-in search macro |
| Proxy Integration | Native support for residential agents and Backconnect, automatically synchronizing timezone/language/coordinates. | Proxy parameters need to be manually configured; there is no automatic GeoIP matching. | Proxy needs to be manually configured; there is no automatic GeoIP matching. |
| Applicable Scenarios | AI Agent Anti-Detection Browsing, Cloud Automation, Production-Grade Data Acquisition | Front-end testing, general web page automation, web crawler development | Traditional end-to-end testing, complex enterprise-level testing frameworks |
Application scenarios of camofox-browse
-
AI Agent Web Automation: Provides a programmable browser backend for LLM-based agents to perform tasks such as data capture, form filling, and information retrieval.
-
E-commerce and competitor monitoring: Bypassing platform anti-scraping mechanisms, it automatically captures product prices, inventory, and review information, and supports account-level data collection even when logged in.
-
Social media automation: After importing cookies, automatically manage accounts on Twitter, LinkedIn, Instagram, etc., and perform content publishing, interaction, and data analysis.
-
Academic and public opinion research: Use search macros to quickly retrieve information from Google, Wikipedia, and Reddit, and extract YouTube video subtitles for content analysis.
-
Cloud-based automated testing: Deployed in a VPS or container environment, it serves as a headless browser service to support end-to-end testing and webpage monitoring in the CI/CD process.