Overview
- Skill Key
- codinglink/xvfb-chrome
- Author
- codinglink
- Source Repo
- openclaw/skills
- Version
- -
- Source Path
- skills/codinglink/xvfb-chrome
- Latest Commit SHA
- bdc32d0e197717dac396f33bde2d2d537d79daf1
在Linux服务器上使用Chrome浏览器(无头/有头模式)配合xvfb运行,可连接chrome-devtools MCP进行浏览器自动化
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 xvfb-chrome 技能。 若已安装,则直接安装 xvfb-chrome 技能。
# XVFB + Chrome 浏览器自动化
在无GUI的Linux服务器上运行Chrome浏览器的完整指南,支持配合 chrome-devtools MCP 使用。
## 模式选择
| 场景 | 推荐方式 |
|------|----------|
| 快速爬取、截图、自动化脚本 | `--headless=new` (无头) |
| 需要调试/连接DevTools MCP | xvfb-run + 非无头 + `--remote-debugging-port=9222` |
| 需要看到浏览器窗口(VNC截图等) | xvfb-run + 非无头 |
## 启动命令
### 1. 无头模式 (常规自动化)
```bash
google-chrome --headless=new --no-sandbox --disable-gpu --user-data-dir=/tmp/chrome-data
```
### 2. 有头 + xvfb + DevTools (推荐 MCP 用户)
```bash
xvfb-run -a google-chrome --no-sandbox \
--disable-gpu --remote-debugging-port=9222 \
--user-data-dir=/tmp/chrome-profile
```
关键点:
- `-a` = 自动分配 display 编号
- 去掉 `--headless` 就是有头模式
- DevTools 监听 `ws://127.0.0.1:9222/devtools/browser/xxx`
### 3. 重启 Chrome (杀旧进程)
```bash
pkill -f "chrome.*remote-debugging-port=9222" 2>/dev/null
sleep 1
xvfb-run -a google-chrome --no-sandbox \
--disable-gpu --remote-debugging-port=9222 \
--user-data-dir=/tmp/chrome-profile &
```
## Chrome DevTools MCP 配合使用
MCP server `chrome-devtools` 已安装,连接 `http://127.0.0.1:9222`:
```bash
mcporter list chrome-devtools --schema # 查看可用工具
mcporter call chrome-devtools.list_pages # 列出页面
```
### 常用 MCP 工具
| 工具 | 功能 |
|------|------|
| `new_page url:"https://xxx"` | 打开新页面 |
| `navigate_page type:"url" url:"https://xxx"` | 导航 |
| `take_screenshot filePath:"/path/xxx.png"` | 截图 |
| `take_snapshot` | 获取页面元素快照 |
| `click uid:"xxx"` | 点击元素 |
| `fill uid:"xxx" value:"xxx"` | 填入表单 |
| `type_text text:"xxx"` | 输入文本 |
| `list_network_requests` | 查看网络请求 |
| `evaluate_script function:"() => { return document.title }"` | 执行JS |
### 完整示例
```bash
# 1. 启动浏览器
xvfb-run -a google-chrome --no-sandbox \
--disable-gpu --remote-debugging-port=9222 \
--user-data-dir=/tmp/chrome-profile &
# 2. 检查是否就绪
curl -s http://127.0.0.1:9222/json/version
#...
capt-marbles
Task Router
capncoconut
Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay, check marketplace stats, or manage agent credentials. Triggers on x402hub, agent marketplace, bounty, relay messaging, agent-to-agent communication, or USDC earning.
capevace
Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.
captchasco
OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.
carol-gutianle
name: modelready description: Start using a local or Hugging Face model instantly, directly from chat. metadata: {"openclaw":{"requires":{"bins": "bash", "curl" }, "env": "URL" }}
canbirlik
Controls Wiz smart bulbs (turn on/off, RGB colors, disco mode) via local WiFi.