← 返回
效率工具 中文

Cdp Browser

CDP browser control at localhost:9222. Use when you need to inspect tabs, take screenshots, navigate, scroll, post to X, or run JS in a persistent browser se...
本地 localhost:9222 CDP 浏览器控制。用于检查标签页、截图、导航、滚动、发 X 推文或在持久化浏览器中运行 JS。
gostlightai
效率工具 clawhub v2.0.1 1 版本 99934.8 Key: 无需
★ 0
Stars
📥 1,532
下载
💾 61
安装
1
版本
#latest

概述

cdp-browser

CLI for Chrome/Chromium at localhost:9222. Inspect tabs, take screenshots, navigate, scroll, post to X, or run JS in a persistent browser session.

Repo: https://github.com/gostlightai/cdp-browser

Prerequisites: Chromium running with --remote-debugging-port=9222. Docker Compose or a local Chrome with remote debugging enabled.

Commands

Run from the skill dir (bin/ scripts):

CommandDescription
----------------------
statusList all tabs (JSON from CDP)
tabsSame as status
new Open new tab
goto Navigate tab to URL
snapshot Full-page screenshot (PNG)
close-popup Dismiss dialogs/modals
`scroll sel> [down\up]`Scroll by pixels or selector
query getUrlReturn current page URL
query getText [selector]Return element text (or body)
query getHtml [selector]Return element HTML (or body)
tweet-draft "text"Fill compose box only; does NOT post
tweet-post --confirm "text"Post tweet (requires --confirm as second arg)
tweet "text"Alias for tweet-draft (fills compose only)

Tweet flow

  • tweet-draft (default): Fills the compose box; user reviews in browser and posts manually.
  • tweet-post: Requires --confirm as second arg (strict). Use when user explicitly approves ("go ahead", "post it", or Telegram confirm button).
  • Optional Telegram confirm: When tweet.confirmButton is enabled in config, the agent can run tweet-draft --save-pending to write pending state, then send a message with an inline "Confirm Post" button. On confirm, the agent runs tweet-post --confirm.

Config (required for Telegram confirm button)

The Telegram "Confirm Post" button only works if config exists. Copy the example and place it in your workspace:

# From the skill dir (e.g. ~/.openclaw/workspace/skills/cdp-browser):
cp .cdp-browser.json.example ~/.openclaw/workspace/.cdp-browser.json

Location: ~/.openclaw/workspace/.cdp-browser.json (or $OPENCLAW_WORKSPACE/.cdp-browser.json)

KeyDefaultDescription
---------------------------
tweet.confirmButtonfalseWhen true, agent sends draft with inline "Confirm Post" button in Telegram. User clicks to approve or says "go ahead".

Without this config, the agent uses plain tweet-draft (no button); user confirms via text only.

Telegram confirm button (agent instructions)

When tweet.confirmButton is true (config present) and you are in a Telegram session:

  1. Draft: Run tweet-draft --save-pending "text" from the skill dir. This fills the compose box and writes ~/.openclaw/workspace/.cdp-browser/pending-tweet.json.
  2. Send with button: Run from the skill dir:

```bash

./scripts/send-tweet-confirm.sh ""

```

Or use openclaw message send directly with --buttons '[[{"text":"Confirm Post","callback_data":"cdp:tweet:confirm"}]]'. Use the current session's reply target as .

  1. On confirm: When the user clicks the button, OpenClaw delivers callback_data: cdp:tweet:confirm. Or the user says "go ahead"/"post it". Treat either as approval. Then:
    • Read ~/.openclaw/workspace/.cdp-browser/pending-tweet.json for text and tabId
    • Run tweet-post --confirm ""
    • Edit or delete the message with the button (optional)
    • Delete the pending file

Scripts

  • cdp.js — Fetch-only wrapper for CDP HTTP API (/json, /json/list, /json/new); no shell.
  • pw.js — Playwright connect to browser; runs snapshot/goto/scroll/query/tweet-draft/tweet-post. Compose launcher: SideNav_NewTweet_Button, /compose/post, Post only (avoids reply buttons). Post button: tweetButton, tweetButtonInline.

Security

See SECURITY.md for mitigations and operational notes.

版本历史

共 1 个版本

  • v2.0.1 当前
    2026-03-29 05:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Casual Cron

gostlightai
根据自然语言创建Clawdbot定时任务,严格运行守卫规则。适用场景:用户请求安排提醒或消息(循环或一次性),尤其是通过Telegram,或使用/at、/every指令。示例:'每天8点提醒'、'20分钟后提醒'、'下午3点发送Telegr
★ 1 📥 3,566
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 440 📥 148,314
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 115,002