在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用puppeteer
星标0
分支0
更新时间2026年4月23日 17:48
Use puppeteer to connect to inspect VSCode
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Use puppeteer to connect to inspect VSCode
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reconcile stale git meshes surfaced by `git mesh stale`. Use when asked to "reconcile stale meshes", "fix stale meshes", "resolve mesh drift", "clean up stale meshes", or when `git mesh stale` exits non-zero with drift.
Use with `git mesh` or meshes.
| name | puppeteer |
| description | Use puppeteer to connect to inspect VSCode |
# === VSCode Extension Development Environment Check ===
CDP_URL="http://127.0.0.1:19222"
CDP_RESPONSE=$(curl -s --connect-timeout 2 "$CDP_URL/json/version" 2>/dev/null)
if [ -z "$CDP_RESPONSE" ]; then
echo "❌ BLOCKED: VSCode not exposing CDP on port 19222"
echo ""
echo "⚠️ ALERT: Cannot connect to Chrome DevTools Protocol at ${CDP_URL}."
echo "Launch VSCode with --remote-debugging-port=19222 to enable browser automation."
echo "EDH commands, screenshot capture, and console log capture are unavailable."
echo "Use the 'Debugging Without Puppeteer' techniques documented below instead."
exit 1
fi
# Extract WS endpoint using node (more reliable than bash string manipulation)
WS_ENDPOINT=$(node -e "console.log(JSON.parse(process.argv[1]).webSocketDebuggerUrl)" "$CDP_RESPONSE" 2>/dev/null)
if [ -z "$WS_ENDPOINT" ]; then
echo "❌ BLOCKED: Could not parse WebSocket endpoint from CDP response"
echo ""
echo "⚠️ ALERT: CDP responded but the WebSocket debugger URL is missing."
echo "Use the 'Debugging Without Puppeteer' techniques documented below instead."
exit 1
fi
node -e "require('puppeteer-core')" 2>/dev/null
if [ $? -ne 0 ]; then
echo "❌ BLOCKED: puppeteer-core is not installed"
echo ""
echo "⚠️ ALERT: Install puppeteer-core in the workspace: yarn add -D puppeteer-core"
echo "Use the 'Debugging Without Puppeteer' techniques documented below instead."
exit 1
fi
echo "✓ Ready"
echo "WS_ENDPOINT=$WS_ENDPOINT"
Important: Run all scripts from aworkspace where puppeteer-core is installed in node_modules. Scripts run from /tmp or other directories will fail with module resolution errors.
node << 'EOF'
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({
browserWSEndpoint: "WS_ENDPOINT_FROM_ABOVE",
defaultViewport: null // Required: prevents Electron window resize
});
const pages = await browser.pages();
console.log("Connected, pages:", pages.length);
// ... your code here
await browser.disconnect(); // NOT close() - keeps VSCode running
EOF
node << 'EOF'
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({
browserWSEndpoint: "WS_ENDPOINT_FROM_ABOVE",
defaultViewport: null
});
const pages = await browser.pages();
const page = pages[0];
// Full page - use captureBeyondViewport: false for Electron
await page.screenshot({
path: "/tmp/current.png",
captureBeyondViewport: false
});
// Element-specific
const element = await page.$(".my-component");
if (element) {
await element.screenshot({ path: "/tmp/component.png" });
}
await browser.disconnect();
EOF
node << 'EOF'
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({
browserWSEndpoint: "WS_ENDPOINT_FROM_ABOVE",
defaultViewport: null
});
const page = (await browser.pages())[0];
const client = await page.createCDPSession();
await client.send("Runtime.enable");
const logs = [];
client.on("Runtime.consoleAPICalled", e => {
const msg = e.args.map(a => a.value ?? a.description).join(" ");
logs.push(`[${e.type}] ${msg}`);
console.log(`[${e.type}]`, msg);
});
// Perform actions...
await new Promise(r => setTimeout(r, 5000));
console.log("Captured", logs.length, "log entries");
await client.detach();
await browser.disconnect();
EOF