mcpField
H
headless-web-viewer

headless-web-viewer

github.com/okwindsDevelopment5036 installsUpdated 24w ago
Repository

About headless-web-viewer

A Playwright-based skill for rendering web pages and saving or printing their content. It is intended for workflows that need page HTML, text, or screenshots as artifacts.

Key features

  1. 01Save rendered HTML, text, and screenshots
  2. 02Print page text to stdout
  3. 03Use Playwright with system Chrome or bundled browsers

Use cases

  1. 01Capture a page as HTML, text, and an image
  2. 02Pipe rendered page text into another command

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/okwinds/miscellany --skill headless-web-viewer

After installing, type/headless-web-viewerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
package.json
package-lock.json
README.zh-CN.md
scripts/
render_url_playwright.mjs

Details

From the project README

Headless Web Viewer

Run

Render + save artifacts
node ./scripts/render_url_playwright.mjs '<URL>' \
  --out-html /tmp/page.html \
  --out-text /tmp/page.txt \
  --out-screenshot /tmp/page.png
Print to stdout (pipe-friendly)
node ./scripts/render_url_playwright.mjs '<URL>' --print text

Dependencies

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:

npm i -D playwright-core

Run with --channel chrome.

Option B (bundled browsers)
npm i -D playwright
npx playwright install

Do not auto-install dependencies unless the user asks.

Tips

  • If a page hangs on networkidle, retry with --wait-until domcontentloaded.
  • If a page blocks headless Chromium, try setting --user-agent to a realistic UA.

Comments

Markdown supported