一键导入
browser-verify
Verify visual changes in the browser via CDP. Connects to the dev server, opens files, takes screenshots, and validates rendering.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Verify visual changes in the browser via CDP. Connects to the dev server, opens files, takes screenshots, and validates rendering.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | browser-verify |
| description | Verify visual changes in the browser via CDP. Connects to the dev server, opens files, takes screenshots, and validates rendering. |
Verify visual changes by connecting to the running dev server via Chrome DevTools Protocol.
The dev server and Chrome must already be running:
npm run dev (Vite on port 5173)npm run chrome (CDP on port 9322)If they aren't running, start them. Only ONE dev server and ONE browser at a time. Kill previous instances first:
kill $(lsof -ti:5173 -ti:5174 -ti:5175) 2>/dev/null; pkill -f "launch-chrome" 2>/dev/null
Connect via CDP. Read scripts/test-helpers.mjs for the helper API.
const { chromium } = require('playwright');
const browser = await chromium.connectOverCDP("http://localhost:9322");
const context = browser.contexts()[0];
const page = context.pages()[0];
page.setDefaultTimeout(10000);
If code was changed since the last check:
await page.reload({ waitUntil: 'networkidle' });
Never open new browser instances -- always reload the existing page.
await page.evaluate(() => __app.openFile("posts/index.md"));
Always open index.md first to verify default rendering. Then open the specific file relevant to your change.
Use __cmDebug helpers via page.evaluate():
const dump = await page.evaluate(() => __cmDebug.dump());
Never use locator.click() on CM6 content. Use page.evaluate() with the debug globals.
Use the screenshot() helper from scripts/test-helpers.mjs, or:
node scripts/screenshot.mjs [file] --output /tmp/coflat-verify.png
Do not call page.screenshot() directly -- Chrome 145's CDP has a headed-mode bug where it hangs indefinitely.
Read the screenshot. Compare against expected rendering. If something is wrong:
page.reload())--disable-infobars./tmp/coflat-*.scripts/test-helpers.mjsscripts/screenshot.mjs