camofox-browser
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCamofox Browser - Anti-Detection Browser Automation
Camofox浏览器 - 反检测浏览器自动化
Stealth browser automation via Camoufox (Firefox fork). C++ level fingerprint spoofing — undetectable by JavaScript-based bot checks. REST API wrapper using .
curl通过Camofox(Firefox分支浏览器)实现隐身浏览器自动化。基于C++层面的指纹伪造技术,可规避基于JavaScript的机器人检测。提供基于的REST API封装。
curlInstallation
安装
First use automatically downloads and installs the Camoufox browser (~300MB, one-time). No manual setup required — just run any command.
camofox首次使用时会自动下载并安装Camoufox浏览器(约300MB,仅需一次)。无需手动配置,只需运行任意命令即可。
camofoxQuick Start
快速开始
bash
camofox open https://example.com # Open URL (auto-starts server)
camofox snapshot # Get page elements with @refs
camofox click @e1 # Click element
camofox type @e2 "hello" # Type text
camofox screenshot # Take screenshot
camofox close # Close tabbash
camofox open https://example.com # Open URL (auto-starts server)
camofox snapshot # Get page elements with @refs
camofox click @e1 # Click element
camofox type @e2 "hello" # Type text
camofox screenshot # Take screenshot
camofox close # Close tabCore Workflow
核心工作流程
- Navigate: — opens tab and navigates
camofox open <url> - Snapshot: — returns accessibility tree with
camofox snapshot,@e1refs@e2 - Interact: Use refs to click, type, select
- Re-snapshot: After navigation or DOM changes, get fresh refs
- Repeat: Server stays running between commands
bash
camofox open https://example.com/login
camofox snapshot- 导航:— 打开标签页并导航至目标地址
camofox open <url> - 快照:— 返回带有
camofox snapshot、@e1等引用标识的可访问性树@e2 - 交互:使用引用标识执行点击、输入、选择等操作
- 重新快照:页面导航或DOM内容变更后,获取新的引用标识
- 重复操作:服务器会在命令之间保持运行状态
bash
camofox open https://example.com/login
camofox snapshot@e1 [input] Email @e2 [input] Password @e3 [button] Sign In
@e1 [input] Email @e2 [input] Password @e3 [button] Sign In
camofox type @e1 "user@example.com"
camofox type @e2 "password123"
camofox click @e3
camofox snapshot # Re-snapshot after navigation
undefinedcamofox type @e1 "user@example.com"
camofox type @e2 "password123"
camofox click @e3
camofox snapshot # Re-snapshot after navigation
undefinedCommands
命令列表
Navigation
导航命令
bash
camofox open <url> # Create tab + navigate (aliases: goto)
camofox navigate <url> # Navigate current tab
camofox back # Go back
camofox forward # Go forward
camofox refresh # Reload page
camofox scroll down # Scroll down (also: up, left, right)bash
camofox open <url> # Create tab + navigate (aliases: goto)
camofox navigate <url> # Navigate current tab
camofox back # Go back
camofox forward # Go forward
camofox refresh # Reload page
camofox scroll down # Scroll down (also: up, left, right)Page State
页面状态命令
bash
camofox snapshot # Accessibility snapshot with @refs
camofox screenshot # Screenshot to /tmp/camofox-screenshots/
camofox screenshot output.png # Screenshot to specific path
camofox tabs # List all open tabsbash
camofox snapshot # Accessibility snapshot with @refs
camofox screenshot # Screenshot to /tmp/camofox-screenshots/
camofox screenshot output.png # Screenshot to specific path
camofox tabs # List all open tabsInteraction (use @refs from snapshot)
交互命令(使用快照中的@refs)
bash
camofox click @e1 # Click element
camofox type @e1 "text" # Type into elementbash
camofox click @e1 # Click element
camofox type @e1 "text" # Type into elementSearch Macros
搜索宏命令
bash
camofox search google "query" # Google search
camofox search youtube "query" # YouTube search
camofox search amazon "query" # Amazon search
camofox search reddit "query" # Reddit search13 macros available — see references/macros-and-search.md.
bash
camofox search google "query" # Google search
camofox search youtube "query" # YouTube search
camofox search amazon "query" # Amazon search
camofox search reddit "query" # Reddit search共提供13个宏命令,详情请查看references/macros-and-search.md。
Session Management
会话管理
bash
camofox --session work open <url> # Isolated session
camofox --session work snapshot # Use specific session
camofox close # Close current tab
camofox close-all # Close all tabs in sessionbash
camofox --session work open <url> # Isolated session
camofox --session work snapshot # Use specific session
camofox close # Close current tab
camofox close-all # Close all tabs in sessionServer Control
服务器控制
bash
camofox start # Start server (usually auto)
camofox stop # Stop server
camofox health # Health checkbash
camofox start # Start server (usually auto)
camofox stop # Stop server
camofox health # Health checkRef Lifecycle (Important)
引用标识生命周期(重要)
Refs (, ) are invalidated when the page changes. Always re-snapshot after:
@e1@e2- Clicking links/buttons that navigate
- Form submissions
- Dynamic content loading
bash
camofox click @e3 # Navigates to new page
camofox snapshot # MUST re-snapshot
camofox click @e1 # Use new refs当页面内容发生变化时,引用标识(、等)会失效。在以下操作后必须重新快照:
@e1@e2- 点击会触发页面导航的链接或按钮
- 提交表单
- 动态内容加载完成
bash
camofox click @e3 # Navigates to new page
camofox snapshot # MUST re-snapshot
camofox click @e1 # Use new refsWhen to Use camofox-browser vs agent-browser
Camofox-browser与agent-browser的适用场景对比
| Scenario | Tool |
|---|---|
| Normal websites, no bot detection | agent-browser (faster) |
| Cloudflare / Akamai protected | camofox-browser |
| Sites that block Chromium automation | camofox-browser |
| Need anti-fingerprinting | camofox-browser |
| Need iOS/mobile simulation | agent-browser |
| Need video recording | agent-browser |
| 场景 | 推荐工具 |
|---|---|
| 普通网站,无反机器人检测 | agent-browser(速度更快) |
| 受Cloudflare / Akamai保护的站点 | camofox-browser |
| 拦截Chromium自动化工具的站点 | camofox-browser |
| 需要反指纹伪造功能 | camofox-browser |
| 需要iOS/移动端模拟 | agent-browser |
| 需要视频录制功能 | agent-browser |
Anti-Detection Capabilities
反检测能力
- C++ level fingerprint spoofing (canvas, WebGL, AudioContext, fonts)
- Firefox-based (not Chromium — different detection surface)
- Human-like interaction timing (parameter)
humanize - WebRTC leak prevention
- No flag
navigator.webdriver
See references/anti-detection.md for details.
- 基于C++层面的指纹伪造(覆盖canvas、WebGL、AudioContext、字体等维度)
- 基于Firefox内核(非Chromium,检测特征完全不同)
- 类人类交互时序控制(参数)
humanize - 防止WebRTC信息泄露
- 无标识
navigator.webdriver
详情请查看references/anti-detection.md。
Environment Variables
环境变量
| Variable | Default | Description |
|---|---|---|
| | Server port |
| | Default session name |
| | Headless mode |
| — | Proxy server |
| 环境变量 | 默认值 | 说明 |
|---|---|---|
| | 服务器端口 |
| | 默认会话名称 |
| | 无头模式开关 |
| — | 代理服务器地址 |
Deep-Dive Documentation
深度文档
| Reference | When to Use |
|---|---|
| references/api-reference.md | Full REST API endpoint docs |
| references/anti-detection.md | Fingerprint spoofing details |
| references/macros-and-search.md | 13 search macros |
| 文档链接 | 适用场景 |
|---|---|
| references/api-reference.md | 完整REST API端点文档 |
| references/anti-detection.md | 指纹伪造技术细节 |
| references/macros-and-search.md | 13个搜索宏命令详情 |
Ready-to-Use Templates
即用型模板
| Template | Description |
|---|---|
| templates/stealth-scrape.sh | Anti-detection scraping workflow |
| templates/multi-session.sh | Multi-session isolation |
| 模板链接 | 说明 |
|---|---|
| templates/stealth-scrape.sh | 反检测爬取工作流模板 |
| templates/multi-session.sh | 多会话隔离模板 |
Troubleshooting
故障排查
Server won't start?
bash
camofox health # Check if running
camofox stop && camofox start # RestartStill getting blocked?
bash
undefined服务器无法启动?
bash
camofox health # Check if running
camofox stop && camofox start # Restart仍然被拦截?
bash
undefinedEnable proxy
Enable proxy
HTTPS_PROXY=socks5://127.0.0.1:1080 camofox open <url>
**Bot detection test:**
```bash
camofox open https://bot.sannysoft.com/
camofox screenshot bot-test.pngHTTPS_PROXY=socks5://127.0.0.1:1080 camofox open <url>
**机器人检测测试:**
```bash
camofox open https://bot.sannysoft.com/
camofox screenshot bot-test.pngCleanup
清理操作
Always close when done:
bash
camofox close-all
camofox stop使用完毕后请务必执行以下命令:
bash
camofox close-all
camofox stop