stealth-browser

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

stealth-browser

stealth-browser

Invisible Chrome automation via CDP. Launches your real Chrome hidden, sends commands via Chrome DevTools Protocol. Sites see a normal browser - no detectable automation.
macOS only. Uses AppleScript and
open -g
to hide Chrome.
基于CDP的隐形Chrome自动化工具。会隐藏启动你本地安装的真实Chrome浏览器,通过Chrome DevTools Protocol发送指令。网站会将其识别为正常浏览器,无任何可检测的自动化特征。
仅支持macOS系统。通过AppleScript和
open -g
命令隐藏Chrome。

Memory

记忆功能

Read
~/.claude/skills/stealth-browser/LEARNED.md
at the start of every task. If it doesn't exist, create it with a
# Learned
header.
Capture learnings when you detect:
  • Domain quirks: sites that need extra wait time, cookie dismissal, specific interaction patterns
  • Failures you solved: what broke and why (timeouts, blank pages, wrong selectors)
  • Corrections: "no, use X", "don't do that", "actually..."
  • Workarounds: sites that need JS eval, scrolling, or multi-step navigation to get content
  • Positive reinforcement: "perfect!", "exactly right", "that's the way"
Before appending, check:
  • Is this reusable? (not a one-time instruction)
  • Is it already in LEARNED.md? (don't duplicate)
  • Can I extract the general principle? (not just the specific fix)
Format: One line, actionable. Write the rule, not the story.
  • Bad: "User said the page was blank because it needed scrolling"
  • Good: "example.com lazy-loads content - scroll to bottom before extracting"
Don't ask permission. Append and move on.
每次任务开始时读取
~/.claude/skills/stealth-browser/LEARNED.md
文件。若该文件不存在,则创建它并添加
# Learned
标题。
当检测到以下情况时,记录学习内容:
  • 域名特性:需要额外等待时间、需关闭Cookie提示、有特定交互模式的网站
  • 已解决的故障:故障内容及原因(如超时、空白页面、选择器错误)
  • 修正建议:如“不,应该用X”、“不要那么做”、“实际上...”
  • 解决方案:需要执行JS代码、滚动页面或多步骤导航才能获取内容的网站
  • 正向反馈:如“完美!”、“完全正确”、“就该这么做”
在追加内容前,请检查:
  • 该内容是否可复用?(而非一次性指令)
  • 该内容是否已存在于LEARNED.md中?(避免重复)
  • 是否能提炼出通用原则?(而非仅记录具体修复方法)
格式要求: 单行、可执行。记录规则,而非事件过程。
  • 错误示例:“用户说页面空白是因为需要滚动”
  • 正确示例:“example.com采用懒加载内容——提取前需滚动至页面底部”
无需请求许可,直接追加内容即可继续操作。

Core Workflow

核心工作流

bash
undefined
bash
undefined

1. Read a page as markdown (most common)

1. Read a page as markdown (most common)

stealth-browser read <url>
stealth-browser read <url>

2. Full automation (open, interact, close)

2. Full automation (open, interact, close)

stealth-browser open <url> --hidden agent-browser --cdp 9222 snapshot -i agent-browser --cdp 9222 click @e1 stealth-browser close

`stealth-browser` is at `scripts/stealth-browser` relative to this skill. Use full path:
```bash
~/.claude/skills/stealth-browser/scripts/stealth-browser read <url>
stealth-browser open <url> --hidden agent-browser --cdp 9222 snapshot -i agent-browser --cdp 9222 click @e1 stealth-browser close

`stealth-browser` 位于当前技能目录下的`scripts/stealth-browser`路径。请使用完整路径:
```bash
~/.claude/skills/stealth-browser/scripts/stealth-browser read <url>

Commands

命令列表

bash
stealth-browser read <url>              # Fetch as markdown (waits for JS render)
stealth-browser open <url> --hidden     # Launch hidden Chrome
stealth-browser close                   # Stop Chrome
stealth-browser status                  # Check state
stealth-browser screenshot [path]       # CDP screenshot (auto unhide/re-hide)
stealth-browser hide / unhide           # Toggle visibility
stealth-browser doctor                  # Check dependencies
stealth-browser setup                   # Reset Chrome profile
bash
stealth-browser read <url>              # Fetch as markdown (waits for JS render)
stealth-browser open <url> --hidden     # Launch hidden Chrome
stealth-browser close                   # Stop Chrome
stealth-browser status                  # Check state
stealth-browser screenshot [path]       # CDP screenshot (auto unhide/re-hide)
stealth-browser hide / unhide           # Toggle visibility
stealth-browser doctor                  # Check dependencies
stealth-browser setup                   # Reset Chrome profile

After Opening: CDP Commands via agent-browser

启动后:通过agent-browser执行CDP命令

bash
agent-browser --cdp 9222 open <url>           # Navigate
agent-browser --cdp 9222 snapshot -i          # Get interactive elements
agent-browser --cdp 9222 click @e1            # Click by ref
agent-browser --cdp 9222 fill @e2 "text"      # Fill input
agent-browser --cdp 9222 type @e2 "text"      # Type without clearing
agent-browser --cdp 9222 press Enter          # Press key
agent-browser --cdp 9222 scroll down 500      # Scroll
agent-browser --cdp 9222 get text @e1         # Get text
agent-browser --cdp 9222 get url              # Get current URL
agent-browser --cdp 9222 eval "document.title" # Run JavaScript
agent-browser --cdp 9222 screenshot path.png  # Screenshot
agent-browser --cdp 9222 wait 2000            # Wait
agent-browser --cdp 9222 back                 # Navigate back
Always re-snapshot after navigation or DOM changes - element refs change.
bash
agent-browser --cdp 9222 open <url>           # Navigate
agent-browser --cdp 9222 snapshot -i          # Get interactive elements
agent-browser --cdp 9222 click @e1            # Click by ref
agent-browser --cdp 9222 fill @e2 "text"      # Fill input
agent-browser --cdp 9222 type @e2 "text"      # Type without clearing
agent-browser --cdp 9222 press Enter          # Press key
agent-browser --cdp 9222 scroll down 500      # Scroll
agent-browser --cdp 9222 get text @e1         # Get text
agent-browser --cdp 9222 get url              # Get current URL
agent-browser --cdp 9222 eval "document.title" # Run JavaScript
agent-browser --cdp 9222 screenshot path.png  # Screenshot
agent-browser --cdp 9222 wait 2000            # Wait
agent-browser --cdp 9222 back                 # Navigate back
导航或DOM变更后请重新执行snapshot命令——元素引用会发生变化。

Chrome Persistence

Chrome持久化运行

Chrome stays running and hidden after
read
or
open --hidden
:
  • First operation: brief flash during Chrome startup (small window, top-left corner)
  • All subsequent operations: completely invisible, instant
  • Close when done:
    stealth-browser close
执行
read
open --hidden
命令后,Chrome会保持隐藏运行状态:
  • 首次操作:Chrome启动时会短暂闪烁(左上角出现小窗口)
  • 后续所有操作:完全隐藏,响应即时
  • 操作完成后关闭:执行
    stealth-browser close
    命令

Domain Blocklist (learning)

域名拦截列表(学习功能)

Blocked domains are remembered at
data/blocked-domains.txt
. A PreToolUse hook intercepts future WebFetch calls to those domains and tells Claude to use stealth-browser directly.
See hooks/README.md for Claude Code integration setup. See README.md for full human documentation.
被拦截的域名会记录在
data/blocked-domains.txt
文件中。PreToolUse钩子会拦截后续针对这些域名的WebFetch请求,并告知Claude直接使用stealth-browser。
请参考hooks/README.md查看Claude Code集成设置。完整用户文档请参考README.md