前言¶
在 DSH「一切皆插件」的工作流裏,瀏覽器控制插件常要面對兩類任務:一類是隔離、可重複的 CI 瀏覽器;另一類是本機已經登錄、帶有本地會話狀態的 Chrome profile。
後一類如果靠 copied profiles、debug profile、remote-debugging port 或 Edge 來遷就,通常會把登錄態和權限邊界搞複雜。bpc-oss/chrome-faithful 針對第二種場景:讓智能體直接驅動真實、已登錄的 Chrome profile。
這是什麼¶
bpc-oss/chrome-faithful 由 bpc-oss 維護。已覈實資料顯示:
- 許可證爲
MIT,README 與package.json都寫明。 package.json標明版本0.4.0。- README 徽章標明
Node >= 22.12。 - README 有 English 和 簡體中文版本。
它把 MCP server、MV3 Chrome extension 和 authenticated localhost bridge 組合在一起。README 描述其 MCP tool surface 爲 38 tools。
核心功能¶
精確多 Profile 路由¶
它用 metadata.profileName 做 exact multi-profile routing。調用者必須選擇一個 exact metadata.profileName。同一個 profile name 的 duplicate live registrations 會被拒絕,避免多個 agent 交錯操作同一個 profile。
啓動與斷開恢復¶
如果目標 profile 或整個 Chrome 已關閉,它會用 ordinary Chrome 啓動 exact profile,並等待 exact extension profileName 註冊後才報告成功。已覈實資料寫明沒有 fallback 到 generic profile、port 9222、Edge 或 UI automation。
目標 disconnected 時,調用者使用:
chrome_profile_catalog
chrome_profile_start
這裏的成功條件是 exact extension profileName 已註冊。
本地橋接與權限邊界¶
Bridge 只綁定 127.0.0.1,並要求 generated secret。已覈實資料描述該 secret 爲 256-bit。
Extension host access 被限制到:
http://127.0.0.1/*
用於 local bridge。Extension 使用 broad capabilities,包括 debugger、history、downloads 和 clipboard permissions。資料還說明 configuration 是 closed-schema,必須位於 source tree 外。
文件上傳與媒體導出¶
文件上傳通過注入 page File / DataTransfer objects 完成,不使用 DOM.setFileInputFiles,也不依賴 OS file chooser。
媒體導出使用:
chrome_page_asset
它帶 tab 的 user agent、referer 和 matching profile cookies 來 stream page-exposed media。
滾動採集與最小化窗口¶
它有 durable virtual-list/scroll capture,包括 asset parity、fail-closed manifests、exclusive cross-process locks 和 resume。Locator waits/actions 和 screenshots 使用 CDP focus emulation,這樣即使 Chrome window 被 minimized 或 obscured,controls 也可以繼續 rendering。
Raw CDP 與驗證¶
Raw CDP 訪問通過:
chrome_cdp
其 event reads 會 redact Network headers、query strings 和 post data。send action 是 deliberately unrestricted raw CDP,只能暴露給 fully trusted MCP client。chrome_cdp with action=send 在 safe-projection boundary 之外,不應給 untrusted clients 或 shared MCP hosts 啓用。
驗證處理包括 challenge detection、click-first solving 和 human handoff。
Codex 兼容 JS API¶
它提供 Codex-compatible JS API:
src/agent-browser.mjs
該文件實現 agent.browsers,讓 JavaScript agents 可以調用同一套 browser surface。
安裝與啓用¶
已覈實資料中未包含完整 DSH 安裝命令;README 的 DSH first-class integration 部分也被截斷。因此這裏不放猜測命令。
已覈實的前置信息如下。
https://github.com/bpc-oss/chrome-faithful
這是 GitHub 倉庫地址,不是安裝命令。
MIT
0.4.0
Node >= 22.12
分別是許可證、package.json 版本和 README 徽章中的 Node 要求。
啓用前以倉庫 README 中完整的 DSH integration 說明爲準,不要把倉庫名直接拼成安裝命令。
典型用法¶
以下順序來自已覈實資料。
- 先選擇 exact profile。
metadata.profileName
這是路由標識,表示調用者必須選定一個 exact profile。
- 如果目標 disconnected,先查詢再啓動。
chrome_profile_catalog
chrome_profile_start
啓動成功的前提是 exact extension profileName 已註冊。
- 在做瀏覽器工作前,先通過 live self-test。
tabs
Runtime.evaluate
這兩項必須先通過。
- 導出頁面暴露的媒體資源時,使用
chrome_page_asset。
chrome_page_asset
它會帶 tab 的 user agent、referer 和 matching profile cookies。
- 需要 raw CDP 時,使用
chrome_cdp。
chrome_cdp
注意 send action 是 unrestricted,只能給 fully trusted client。
適用場景與注意¶
適合¶
- 需要在 DSH 智能體裏控制真實、已登錄 Chrome profile 的團隊。
- 多 profile 併發,並且需要按 exact
profileName隔離。 - 不想使用 copied profiles、debug profile、
remote-debugging port或 Edge。
不適合¶
- 需要 deterministic、disposable CI 瀏覽器時,README 建議改用 Playwright 或 Puppeteer。
注意¶
- 插件以當前 dsh 進程權限運行。安裝前應檢查源碼與許可證。
- Extension 擁有 broad capabilities:
debugger、history、downloads、clipboard permissions。 - Configuration 是 closed-schema,並必須位於 source tree 外。
- Windows installers 被描述爲 transactional,帶 SHA-256-verified、DPAPI-encrypted backups。
chrome_cdp的sendaction 在 safe-projection boundary 之外,不要給 untrusted clients 或 shared MCP hosts 啓用。
結尾¶
bpc-oss/chrome-faithful 的價值在於把“控制已登錄 Chrome”這件事收束到 exact profile、localhost bridge 和顯式 trust boundary 上。它不是面向通用 CI 的瀏覽器方案,而是面向真實本地 profile 的 DSH 瀏覽器控制插件。
DSH 的理念是「一切皆插件」,社區目錄是獨立站點。已覈實資料未包含具體目錄頁 URL;GitHub 地址如下:
https://github.com/bpc-oss/chrome-faithful