Back to list
palewire

browser-screenshots

by palewire

The syllabus for "JOUR 73361: Coding the News," a course taught at the City University of New York's Craig Newmark Graduate School of Journalism

0🍴 0📅 Jan 21, 2026

SKILL.md


name: browser-screenshots description: Captures browser screenshots on request using Playwright for embedding in tutorials.

Browser Screenshot Capture

Capture browser screenshots when the user requests them. This skill uses a Playwright-based script to automate browser interactions and save screenshots directly to disk.

When to Use

Use this skill when the user asks you to:

  • Capture a screenshot of a specific URL
  • Document a web page or web application state
  • Take screenshots of a locally running development server
  • Capture a sequence of browser interactions

How to Capture

Use the Playwright capture script located at skills/browser-screenshots/scripts/capture.cjs.

Basic Screenshot

node skills/browser-screenshots/scripts/capture.cjs \
  --url https://example.com \
  --output static/screenshots/week-1/example-homepage.png

Common Options

OptionDescriptionDefault
--urlURL to capture (required)-
--outputOutput file path (required)-
--widthViewport width1280
--heightViewport height800
--fullpageCapture full scrollable pagefalse
--elementCSS selector to capture specific element-
--highlightCSS selector to highlight with red border-
--executeJavaScript to run before capture-
--waitMilliseconds to wait before capture500
--darkUse dark color schemefalse

Examples

Capture with dark mode:

node skills/browser-screenshots/scripts/capture.cjs \
  --url https://code.visualstudio.com \
  --dark \
  --output static/screenshots/week-1/vscode-homepage.png

Highlight a specific element:

node skills/browser-screenshots/scripts/capture.cjs \
  --url https://github.com/new \
  --highlight ".repo-name-input" \
  --output static/screenshots/week-1/github-repo-name.png

Capture a specific element only:

node skills/browser-screenshots/scripts/capture.cjs \
  --url https://example.com \
  --element ".hero-section" \
  --output static/screenshots/week-1/hero-only.png

Execute JavaScript before capture (e.g., click a button):

node skills/browser-screenshots/scripts/capture.cjs \
  --url https://example.com \
  --execute "document.querySelector('button').click()" \
  --wait 1000 \
  --output static/screenshots/week-1/after-click.png

Full page screenshot:

node skills/browser-screenshots/scripts/capture.cjs \
  --url https://example.com \
  --fullpage \
  --output static/screenshots/week-1/full-page.png

Saving Screenshots

Save to /static/screenshots/week-{week}/ with descriptive kebab-case filenames.

Naming convention: Use kebab-case:

  •  github-new-repo.png
  •  homepage-hero-section.png
  •  GitHubNewRepo.png

Directory structure:

static/screenshots/
  week-1/
    vscode-homepage.png
    github-new-repo.png
  week-2/
    ...

Embedding in Tutorials

When embedding in .svx files, use the Screenshot component:

<script>
  import Screenshot from '$lib/components/Screenshot.svelte';
</script>

<Screenshot 
  src="/screenshots/week-1/github-new-repo.png" 
  alt="GitHub new repository form"
  chromeTitle="Create a new repository"
  chromeUrl="https://github.com/new"
/>

Component Props

PropTypeDefaultDescription
srcstringrequiredPath relative to /static/
altstringrequiredAccessibility description
showChromebooleantrueBrowser window styling
chromeTitlestring''Title bar text
chromeUrlstring''Address bar URL

Prerequisites

Playwright must be installed. If not already installed:

npm install playwright
npx playwright install chromium

Limitations

  • Cannot capture: VS Code windows, terminal output, system dialogs (these require manual screenshots)
  • Requires network access: URLs must be reachable from the machine running the script

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon