核心概念與設計哲學
dev-browser 是一個瀏覽器自動化工具,讓人工智慧 Agent 和開發者能以沙箱隔離的 JavaScript 程式控制瀏覽器。該專案採用「bitter-lesson」設計理念——不發明新的瀏覽器自動化語法,而是直接使用既有的「Playwright」API。作者直言市場上已有數百個瀏覽器 Agent CLI(連創業家 Garry Tan 都有一個),但 dev-browser 的核心競爭力在於其設計哲學:讓 Agent 直接寫程式,而非學習專門語法。
核心功能與架構
該工具提供以下主要特性:
- 沙箱執行環境 — 程式在 QuickJS WASM 沙箱中執行,無法存取主機檔案系統或網路
- 持久化頁面 — 導航一次後,可在多個程式中與同一頁面互動
- 自動連線 — 自動連接運行中的 Chrome 或啟動新的 Chromium 實例
- 完整 Playwright API 支援 — goto、click、fill、locators、evaluate、screenshots 等所有功能
安裝非常簡單:npm i -g dev-browser,無需額外外掛或技能安裝。使用者只需告訴 Agent 「使用 dev-browser」,Agent 即可執行 dev-browser --help 查看完整的 LLM 使用指南和 API 參考。
演進與改進
原始的 dev-browser 只是一個 Markdown 檔案搭配直接呼叫 Playwright 的幾個程式,簡單但啟動速度慢,且必須讓 Agent 執行任意的 Node.js 程式——存在明顯的安全和效能問題。發佈後,瀏覽器 skill 領域出現大量創新,new dev-browser 因此進行了重大升級,引入了沙箱隔離執行和限制式檔案 I/O 等安全機制。
性能實證與市場位置
根據官方評測結果,dev-browser 在多項指標上領先競爭方案:
- 執行時間:3 分 53 秒(Playwright MCP 4 分 31 秒、Playwright Skill 8 分 07 秒、Claude Chrome Extension 12 分 54 秒)
- 成本:$0.88(MCP 為 $1.45、Skill 為 $1.45、Chrome Extension 為 $2.81)
- 互動次數:29 次(MCP 51 次、Skill 38 次、Chrome Extension 80 次)
- 成功率:100%(Skill 僅 67%,其他均 100%)
這些數據清楚表明,讓 Agent 直接撰寫 Playwright 程式的方式遠優於其他抽象化或圖形介面方案。該專案已累積 4000 星星,反映社群認可。
實際應用與整合
使用者可在 Claude Code 等環境中無許可提示地執行 dev-browser,只需在 .claude/settings.json 或 ~/.claude/settings.json 中將其加入允許清單。script API 提供完整的瀏覽器控制功能(browser.getPage、browser.newPage、browser.listPages 等)和受限的檔案 I/O(僅限 ~/.dev-browser/tmp/ 目錄),搭配完整的 Playwright Page 物件功能如 page.snapshotForAI 為 AI 提供友善的頁面快照。該工具由 Sawyer Hood 開發,採 MIT 授權。
Introducing the new dev-browser cli.
— Sawyer Hood (@sawyerhood) March 25, 2026
The fastest way for an agent to use a browser is to let it write code.
Just `npm i -g dev-browser` and tell your agent to "use dev-browser" pic.twitter.com/U8VmsT5XVc
there are like 100s browser agent clis (even Garry Tan has one) why use this one?
— Sawyer Hood (@sawyerhood) March 25, 2026
dev-browser is incredibly bitter-lesson pilled. Rather than inventing a new syntax for browser automation, just use the one they already know: Playwright. pic.twitter.com/hugnrwofkw
the original dev-browser was just a markdown file and a few scripts that called playwright directly. simple, but slow startup and you had to let your agent run arbitrary node scripts. since its release there has been a lot of innovation in the browser skill space (from things…
— Sawyer Hood (@sawyerhood) March 25, 2026
fittingly we just hit 4k stars on github! Check it out today!https://t.co/YRQeSqjtrA
— Sawyer Hood (@sawyerhood) March 25, 2026
