@askjo/camoufox-browser

中文文档
1.0.12发布于 2026/02/02MITCommonJS近 30 天下载 4095

Headless browser automation server and OpenClaw plugin for AI agents - anti-detection, element refs, and session isolation

此软件包已被标记为弃用

Renamed to @askjo/camofox-browser

原始使用文档
文档目录22 节
  1. Motivation
  2. Features
  3. Quick Start
  4. OpenClaw Plugin
  5. Standalone Server
  6. API Overview
  7. Create a Tab
  8. Get Page Snapshot (with element refs)
  9. Click an Element
  10. Search with Macros
  11. All Endpoints
  12. Search Macros
  13. Architecture
  14. Running Locally
  15. Experimental
  16. Docker Deployment
  17. Fly.io Deployment
  18. Testing
  19. Environment Variables
  20. Contributing
  21. Credits
  22. License

camoufox-browser

A headless browser automation server designed for AI agents. Powered by Camoufox - a Firefox-based browser with C++ anti-detection that bypasses bot detection including Google captcha.

This is the same browser engine that powers askjo.ai's web scraping capabilities.

Perfect for: OpenClaw, Claude Code, LangChain agents, AutoGPT, and any AI system that needs to browse the web.

Motivation

AI agents need to browse the web, but current solutions have significant limitations:

  • Playwright/Puppeteer + stealth plugins get detected and blocked by Google, Cloudflare, and most anti-bot systems. JavaScript-level evasion isn't enough.
  • Headless Chrome is trivially fingerprinted. Sites check for hundreds of browser characteristics that reveal automation.
  • API-based scrapers (Browserless, ScrapingBee) work but cost money per request and add latency.
  • Raw HTTP requests can't handle JavaScript-rendered content or complex interactions.

Camoufox solves this with C++ level anti-detection baked into the Firefox source code itself - not a plugin that can be detected, but fundamental changes to how the browser reports its fingerprint. This is the same approach used by commercial anti-detect browsers.

This project wraps Camoufox in a simple REST API optimized for AI agents: accessibility snapshots instead of bloated HTML, stable element refs for reliable clicking, and search macros for common sites.

Features

  • Anti-Detection - Camoufox engine (Firefox-based) with C++ fingerprint spoofing, bypasses Google captcha
  • Element Refs - Stable e1, e2, e3 references for clicking/typing
  • Session Isolation - Separate cookies/storage per user, tabs grouped by conversation
  • Search Macros - 13 built-in URL macros (@google_search, @youtube_search, etc.)
  • Token-Efficient - Accessibility snapshots instead of full HTML (90% smaller)
  • Docker Ready - Production Dockerfile with pre-baked Camoufox binary

Quick Start

OpenClaw Plugin

Install as an OpenClaw plugin for agent tool access:

openclaw plugins install @askjo/camoufox-browser

Then start the server and configure:

# ~/.openclaw/openclaw.json
plugins:
  entries:
    camoufox-browser:
      enabled: true
      config:
        url: "http://localhost:9377"

The plugin provides these agent tools:

  • camoufox_create_tab - Create a browser tab
  • camoufox_snapshot - Get page snapshot with element refs
  • camoufox_click - Click elements by ref
  • camoufox_type - Type into elements
  • camoufox_navigate - Navigate to URLs or use search macros
  • camoufox_scroll - Scroll the page
  • camoufox_screenshot - Take screenshots
  • camoufox_close_tab - Close tabs
  • camoufox_list_tabs - List open tabs

Standalone Server

# Clone and install
git clone https://github.com/jo-inc/camoufox-browser
cd camoufox-browser
npm install

# Start server (downloads Camoufox browser on first run)
npm start                    # Default port 3000
./run-camoufox.sh -p 3001    # Custom port

# Server runs on http://localhost:3000

API Overview

Create a Tab

curl -X POST http://localhost:3000/tabs \
  -H "Content-Type: application/json" \
  -d '{"userId": "user1", "sessionKey": "conv1", "url": "https://example.com"}'

Get Page Snapshot (with element refs)

curl "http://localhost:3000/tabs/TAB_ID/snapshot?userId=user1"

Response includes refs for interaction:

{
  "snapshot": "[button e1] Submit  [link e2] Learn more",
  "refs": {
    "e1": { "role": "button", "name": "Submit" },
    "e2": { "role": "link", "name": "Learn more" }
  },
  "url": "https://example.com"
}

Click an Element

curl -X POST http://localhost:3000/tabs/TAB_ID/click \
  -H "Content-Type: application/json" \
  -d '{"userId": "user1", "ref": "e1"}'

Search with Macros

curl -X POST http://localhost:3000/tabs/TAB_ID/navigate \
  -H "Content-Type: application/json" \
  -d '{"userId": "user1", "macro": "@google_search", "query": "best coffee beans"}'

All Endpoints

MethodPathDescription
GET/healthHealth check
GET/tabs?userId=XList all tab groups for user
POST/tabsCreate new tab
DELETE/tabs/:tabIdClose tab
POST/tabs/:tabId/navigateNavigate to URL or macro
GET/tabs/:tabId/snapshotGet accessibility snapshot with refs
POST/tabs/:tabId/clickClick element by ref or selector
POST/tabs/:tabId/typeType into element
POST/tabs/:tabId/scrollScroll page
POST/tabs/:tabId/backGo back
POST/tabs/:tabId/forwardGo forward
POST/tabs/:tabId/refreshRefresh page
GET/tabs/:tabId/linksGet all links
GET/tabs/:tabId/screenshotGet screenshot
DELETE/sessions/:userIdClose all tabs for user

Search Macros

Navigate supports these macros for common sites:

  • @google_search - Google
  • @youtube_search - YouTube
  • @amazon_search - Amazon
  • @reddit_search - Reddit
  • @wikipedia_search - Wikipedia
  • @twitter_search - Twitter/X
  • @yelp_search - Yelp
  • @spotify_search - Spotify
  • @netflix_search - Netflix
  • @linkedin_search - LinkedIn
  • @instagram_search - Instagram
  • @tiktok_search - TikTok
  • @twitch_search - Twitch

Architecture

Browser Instance
└── User Session (BrowserContext) - isolated cookies/storage
    ├── Tab Group (sessionKey: "conv1") - conversation A
    │   ├── Tab (google.com)
    │   └── Tab (github.com)
    └── Tab Group (sessionKey: "conv2") - conversation B
        └── Tab (amazon.com)
  • One browser instance shared across users
  • Separate BrowserContext per user (isolated cookies/storage)
  • Tabs grouped by sessionKey (conversation/task)
  • 30-minute session timeout with automatic cleanup

Running Locally

# Start with default port (3000)
./run-camoufox.sh
# Or: npm start

# Start with custom port
./run-camoufox.sh -p 3001

First run downloads the Camoufox browser (~300MB).

Experimental

See experimental/ for alternative browser engines.

Docker Deployment

# Build with Camoufox (recommended)
docker build -f Dockerfile.camoufox -t camoufox-browser .

# Run
docker run -p 3000:3000 camoufox-browser

Fly.io Deployment

fly launch --no-deploy
fly deploy

Testing

npm test                 # Run all e2e tests
npm run test:live        # Run live Google tests (may hit captcha)
npm run test:debug       # Show server output for debugging

Environment Variables

VariableDescriptionDefault
PORTServer port3000
NODE_ENVEnvironmentdevelopment

Contributing

Contributions are welcome! Please open an issue or submit a PR.

Credits

  • Camoufox - Firefox-based browser with C++ anti-detection
  • Amp - AI coding agent

License

MIT

版本与发布记录

@askjo/camoufox-browser 共发布 11 个版本,首次发布于 2026/02/01;过去 12 个月发布了 11 个版本。

版本发布日期距今
1.0.12latest2026/02/029 个月前
1.0.112026/02/019 个月前
1.0.92026/02/019 个月前
1.0.82026/02/019 个月前
1.0.72026/02/019 个月前
1.0.62026/02/019 个月前

关于 @askjo/camoufox-browser 的常见问题

@askjo/camoufox-browser 是什么?

Headless browser automation server and OpenClaw plugin for AI agents - anti-detection, element refs, and session isolation注意:该包已被作者标记为弃用——Renamed to @askjo/camofox-browser

如何安装 @askjo/camoufox-browser?

在项目目录运行 npm install @askjo/camoufox-browser,或使用 pnpm add / yarn add / bun add。

@askjo/camoufox-browser 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/askjo__camoufox-browser 是否存在。

@askjo/camoufox-browser 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@askjo/camoufox-browser 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@askjo/camoufox-browser 可以商用吗?

@askjo/camoufox-browser 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@askjo/camoufox-browser 的下载量有多少?

根据 npm 官方下载统计,@askjo/camoufox-browser 在 2026/10/07 – 2026/11/05 这 30 天内被下载 4,095 次,日均约 137 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@askjo/camoufox-browser 还在维护吗?

最新版本 1.0.12 发布于 2026/02/02(9 个月前);至今共发布 11 个版本,其中过去 12 个月发布了 11 个;首次发布于 2026/02/01。作者已将其标记为弃用,新项目建议寻找替代方案。