/install camofox-browser
camofox-browser Agent Guide
Headless browser automation server for AI agents. Run locally or deploy to any cloud provider.
Quick Start for Agents
# Install and start
npm install && npm start
# Server runs on http://localhost:9377
Core Workflow
- Create a tab → Get
tabId - Navigate → Go to URL or use search macro
- Get snapshot → Receive page content with element refs (
e1,e2, etc.) - Interact → Click/type using refs
- Repeat steps 3-4 as needed
API Reference
Create Tab
POST /tabs
{"userId": "agent1", "sessionKey": "task1", "url": "https://example.com"}
Returns: {"tabId": "abc123", "url": "...", "title": "..."}
Navigate
POST /tabs/:tabId/navigate
{"userId": "agent1", "url": "https://google.com"}
# Or use macro:
{"userId": "agent1", "macro": "@google_search", "query": "weather today"}
Get Snapshot
GET /tabs/:tabId/snapshot?userId=agent1
Returns accessibility tree with refs:
[heading] Example Domain
[paragraph] This domain is for use in examples.
[link e1] More information...
Click Element
POST /tabs/:tabId/click
{"userId": "agent1", "ref": "e1"}
# Or CSS selector:
{"userId": "agent1", "selector": "button.submit"}
Type Text
POST /tabs/:tabId/type
{"userId": "agent1", "ref": "e2", "text": "hello world"}
# Add enter: {"userId": "agent1", "ref": "e2", "text": "search query", "pressEnter": true}
Scroll
POST /tabs/:tabId/scroll
{"userId": "agent1", "direction": "down", "amount": 500}
Navigation
POST /tabs/:tabId/back {"userId": "agent1"}
POST /tabs/:tabId/forward {"userId": "agent1"}
POST /tabs/:tabId/refresh {"userId": "agent1"}
Get Links
GET /tabs/:tabId/links?userId=agent1&limit=50
Close Tab
DELETE /tabs/:tabId?userId=agent1
Search Macros
Use these instead of constructing URLs:
| Macro | Site |
|---|---|
@google_search |
|
@youtube_search |
YouTube |
@amazon_search |
Amazon |
@reddit_search |
|
@wikipedia_search |
Wikipedia |
@twitter_search |
Twitter/X |
@yelp_search |
Yelp |
@linkedin_search |
Element Refs
Refs like e1, e2 are stable identifiers for page elements:
- Call
/snapshotto get current refs - Use ref in
/clickor/type - Refs reset on navigation - get new snapshot after
Session Management
userIdisolates cookies/storage between userssessionKeygroups tabs by conversation/task (legacy:listItemIdalso accepted)- Sessions timeout after 30 minutes of inactivity
- Delete all user data:
DELETE /sessions/:userId
Running Engines
Camoufox (Default)
npm start
# Or: ./run.sh
Firefox-based with anti-detection. Bypasses Google captcha.
Testing
npm test # E2E tests
npm run test:live # Live Google tests
npm run test:debug # With server output
Docker
docker build -t camofox-browser .
docker run -p 9377:9377 camofox-browser
Key Files
server.js- Camoufox engine (routes + browser logic only — NOprocess.envorchild_process)lib/config.js- Allprocess.envreads centralized herelib/youtube.js- YouTube transcript extraction via yt-dlp (child_processisolated here)lib/launcher.js- Subprocess spawning (child_processisolated here)lib/cookies.js- Cookie file I/Olib/metrics.js- Prometheus metrics (lazy-loaded, off by default — setPROMETHEUS_ENABLED=1)lib/request-utils.js- HTTP request classification helpers (actionFromReq,classifyError)lib/snapshot.js- Accessibility tree snapshotlib/macros.js- Search macro URL expansionDockerfile- Production container
OpenClaw Scanner Isolation (CRITICAL)
OpenClaw's skill-scanner flags plugins that have process.env + network calls (e.g. app.post, fetch, http.request) in the same file, or child_process + network calls in the same file. These patterns suggest potential credential exfiltration.
Rule: No single .js file may contain both halves of a scanner rule pair:
process.envlives ONLY inlib/config.jschild_process/execFile/spawnlive ONLY inlib/youtube.jsandlib/launcher.jsserver.jshas the Express routes (app.post,app.get) but ZEROprocess.envreads and ZEROchild_processimportslib/metrics.jshas NOprocess.envand NO HTTP method strings (POST,fetch). Prometheus is lazy-loaded only whenPROMETHEUS_ENABLED=1.lib/request-utils.jshas HTTP method strings (POST) but NOprocess.env— safe.- When adding new features that need env vars or subprocesses, put that code in a
lib/module and import the result intoserver.js
Scanner rule details (from src/security/skill-scanner.ts):
env-harvesting(CRITICAL): fires when/process\.env/AND/\bfetch\b|\bpost\b|http\.request/imatch the SAME file. Note: the regex is case-insensitive, so string literals like'POST'and even comments containingprocess.envwill trigger it.dangerous-exec(CRITICAL):child_processimport +exec/spawncall in same filepotential-exfiltration(WARN):readFile+fetch/post/http.requestin same file
This was broken in 1.3.0 (YouTube child_process in server.js), fixed in 1.3.1. Broken again in 1.4.1 (metrics.js had process.env in a comment + 'POST' in actionFromReq), fixed in 1.5.1 by lazy-loading prom-client and splitting actionFromReq into lib/request-utils.js.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install camofox-browser - After installation, invoke the skill by name or use
/camofox-browser - Provide required inputs per the skill's parameter spec and get structured output
What is Camofox Browser?
Headless browser server enabling AI agents to create tabs, navigate, interact, and capture snapshots with element references locally or in the cloud. It is an AI Agent Skill for Claude Code / OpenClaw, with 145 downloads so far.
How do I install Camofox Browser?
Run "/install camofox-browser" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Camofox Browser free?
Yes, Camofox Browser is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Camofox Browser support?
Camofox Browser is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Camofox Browser?
It is built and maintained by sheffk78 (@sheffk78); the current version is v1.0.0.