Loading...
Loading...
Compare original and translation side by side
chrome-remote-interfacenpm install -g chrome-remote-interfacechrome-remote-interfacenpm install -g chrome-remote-interfacescripts/cdp-launch.jsscripts/cdp-type.jsscripts/cdp-launch.jsscripts/cdp-type.jsscripts/cdp-launch.jsNODE_PATH=$(npm root -g) node scripts/cdp-launch.js| URL | Purpose |
|---|---|
| (default) | |
| Open home feed |
| Search posts |
~/.chrome-cdp-profilescripts/cdp-launch.jsNODE_PATH=$(npm root -g) node scripts/cdp-launch.js| URL | 用途 |
|---|---|
| (默认) | |
| 打开首页信息流 |
| 搜索推文 |
~/.chrome-cdp-profilescripts/cdp-type.jsecho '[{"text":"Hello world!"}]' | NODE_PATH=$(npm root -g) node scripts/cdp-type.jsscripts/cdp-type.jsecho '[{"text":"Hello world!"}]' | NODE_PATH=$(npm root -g) node scripts/cdp-type.js| Segment | Effect |
|---|---|
| Insert text (emoji/unicode safe) |
| Single line break |
| Multiple line breaks |
| 片段 | 效果 |
|---|---|
| 插入文本(支持表情符号/Unicode) |
| 插入单个换行符 |
| 插入多个换行符 |
cat << 'EOF' | NODE_PATH=$(npm root -g) node scripts/cdp-type.js
[
{"text": "Hook line with emoji"},
{"enter": 2},
{"text": "Main content paragraph."},
{"enter": 2},
{"text": "- Point one"},
{"enter": true},
{"text": "- Point two"},
{"enter": 2},
{"text": "https://example.com"},
{"enter": true},
{"text": "#hashtag #tags"}
]
EOFcat << 'EOF' | NODE_PATH=$(npm root -g) node scripts/cdp-type.js
[
{"text": "Hook line with emoji"},
{"enter": 2},
{"text": "Main content paragraph."},
{"enter": 2},
{"text": "- Point one"},
{"enter": true},
{"text": "- Point two"},
{"enter": 2},
{"text": "https://example.com"},
{"enter": true},
{"text": "#hashtag #tags"}
]
EOF| Issue | Fix |
|---|---|
| Chrome not connecting | |
| No X.com tab found | Launch Chrome first, wait 3s |
| Text not typing | Click compose box in browser first |
| Module not found | |
| Login required | Use default profile path ( |
| 问题 | 解决方法 |
|---|---|
| Chrome无法连接 | 执行 |
| 未找到X.com标签页 | 先启动Chrome浏览器,等待3秒 |
| 文本无法输入 | 先点击浏览器中的撰写框 |
| 模块未找到 | 执行 |
| 需要登录 | 使用默认配置文件路径( |
NODE_PATH=$(npm root -g)chrome-remote-interfaceInput.insertText()--user-data-dirNODE_PATH=$(npm root -g)chrome-remote-interfaceInput.insertText()--user-data-dir