headless-web-viewer
Original:🇺🇸 English
Translated
1 scripts
Render and view webpages using a headless browser (Playwright) to fetch JS-rendered HTML, extract visible text, and optionally save full-page screenshots. Use when a user asks to “无头浏览器打开/查看网页”, needs the rendered DOM instead of raw curl HTML, or wants a screenshot of a page.
2installs
Sourceokwinds/miscellany
Added on
NPX Install
npx skill4agent add okwinds/miscellany headless-web-viewerTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Headless Web Viewer
Run
Render + save artifacts
bash
node ./scripts/render_url_playwright.mjs '<URL>' \
--out-html /tmp/page.html \
--out-text /tmp/page.txt \
--out-screenshot /tmp/page.pngPrint to stdout (pipe-friendly)
bash
node ./scripts/render_url_playwright.mjs '<URL>' --print textDependencies
This skill requires Playwright in the environment where it runs.
Option A (recommended for global use, no browser download)
Install Playwright Core and use system Chrome:
bash
npm i -D playwright-coreRun with .
--channel chromeOption B (bundled browsers)
bash
npm i -D playwright
npx playwright installDo not auto-install dependencies unless the user asks.
Tips
- If a page hangs on , retry with
networkidle.--wait-until domcontentloaded - If a page blocks headless Chromium, try setting to a realistic UA.
--user-agent