full-page-screenshot
Use when the user asks to capture a full-page screenshot, long screenshot, or complete page capture of a web page. Handles SPA scroll containers, lazy-loaded images, and very tall pages via Chrome DevTools Protocol with zero external dependencies.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o full-page-screenshot.zip https://jpskill.com/download/21858.zip && unzip -o full-page-screenshot.zip && rm full-page-screenshot.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21858.zip -OutFile "$d\full-page-screenshot.zip"; Expand-Archive "$d\full-page-screenshot.zip" -DestinationPath $d -Force; ri "$d\full-page-screenshot.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
full-page-screenshot.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
full-page-screenshotフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] full-page-screenshot
フルページスクリーンショット
Chrome DevTools Protocol を介して、任意のウェブページのフルページスクリーンショットをキャプチャします。スクロールが必要な部分を含むすべてのコンテンツを単一の PNG ファイルとして生成します。Node.js 22+ とリモートデバッグが有効な Chrome 以外の外部依存関係は一切ありません。
前提条件
- Node.js 22+ (組み込みの
WebSocketを使用します) - リモートデバッグが有効な Chrome/Chromium
環境の準備状況を確認します。
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" --check
Chrome のチェックが失敗した場合は、ユーザーに chrome://inspect/#remote-debugging を開き、「このブラウザインスタンスのリモートデバッグを許可する」を有効にするよう指示してください。
ワークフロー
オプション A: すでに開いているタブのスクリーンショットを撮る(認証済みページに推奨)
- 利用可能なタブを一覧表示します。
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" --list
- タイトル/URL でターゲットを特定し、キャプチャします。
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" <targetId> /tmp/screenshot.png --width 1200 --dpr 1
オプション B: URL のスクリーンショットを撮る(バックグラウンドタブを開き、キャプチャし、閉じる)
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" --url "https://example.com" /tmp/screenshot.png --width 1200 --dpr 1 --wait 15000
注:
--urlモードはバックグラウンドタブを作成します。認証(SSO、ログインウォール)が必要なページでは、代わりにオプション A を使用してください。
パラメータ
| パラメータ | 説明 | デフォルト |
|---|---|---|
output |
出力 PNG ファイルパス | /tmp/screenshot.png |
--width |
ビューポートの幅(CSS ピクセル単位)(記事: 1200、ダッシュボード: 1440-1920) | 1200 |
--dpr |
デバイスピクセル比(2 = Retina、ただしファイルサイズは 4 倍) | 1 |
--wait |
ページ読み込みタイムアウト(ミリ秒単位)(--url モードのみ) |
15000 |
--css |
キャプチャ前に挿入するカスタム CSS(例: 要素を非表示にする) | — |
出力の検証
# macOS
sips -g pixelWidth -g pixelHeight /tmp/screenshot.png
# Linux
file /tmp/screenshot.png
主要な機能
-
SPA スクロールコンテナの拡張 —
overflow-y: auto/scrollコンテナを検出し、それらをスクロールして遅延読み込みをトリガーし、オーバーフロー制約(Tailwind のh-[calc(...)]を含む)を削除して、すべてのコンテンツが一度にレンダリングされるようにします。 -
DOM 安定性検出 —
readyState=completeの後、DOM 要素の数が安定するまで監視します。これにより、SPA フレームワークが動的コンテンツのレンダリングを完了するのを確実にします。 -
遅延読み込みのトリガー — ビューポートを段階的にスクロールして
IntersectionObserverコールバックを起動し、すべての<img>要素が読み込みを完了するまで待機します。 -
非常に長いページのタイルキャプチャ — 16,000px を超えるページは 8,000px のタイルでキャプチャされ、Python PIL を使用して自動的に結合されます。PIL が利用できない場合は、タイルを個別に保存するフォールバックします。
-
Chrome の自動検出 —
DevToolsActivePortファイルを読み取ってデバッグポートを見つけます。ポート 9222、9229、9333 をプローブするフォールバックします。 -
CDP プロキシのフォールバック — CDP プロキシがブラウザの WebSocket を保持している場合、スクリプトはキャプチャのためにプロキシ API エンドポイント(
/eval、/screenshot、/scroll)にフォールバックします。
仕組み
1. Chrome デバッグポートを検出
2. WebSocket (CDP) 経由で接続
3. ターゲットにアタッチ / バックグラウンドタブを作成
4. Emulation ドメイン経由でビューポート幅を設定
5. 待機: readyState + DOM 安定性
6. スクロールコンテナを検出して展開
7. ページをスクロール (遅延読み込みをトリガー)
8. 画像の完了を待機
9. 最終的なコンテンツの高さを測定
10. Page.captureScreenshot (またはタイルキャプチャ)
11. 必要に応じてタイルを結合 (PIL)
12. ビューポートを復元、デタッチ、クリーンアップ
アンチパターン
| やらないこと | 代わりにやること |
|---|---|
10,000px を超えるページで --dpr 2 を使用する |
Chrome のメモリ問題を避けるため --dpr 1 を使用してください |
認証済み/SSO ページで --url を使用する |
ユーザーがログインしているタブで --list + targetId を使用してください |
SPA の --wait を 5000 未満に設定する |
SPA はデータの取得とレンダリングに時間が必要です。10000-15000 を使用してください |
最初に --check を確認せずにキャプチャする |
常に Chrome デバッグが利用可能であることを確認してください |
| すべてのページでビューポート幅をハードコードする | 記事には 1200、ダッシュボード/テーブルには 1440+ を使用してください |
| 出力検証をスキップする | キャプチャ後、常に sips または file コマンドで検証してください |
トラブルシューティング
| 症状 | 原因 | 解決策 |
|---|---|---|
| 「Chrome デバッグポートが見つかりません」 | リモートデバッグが有効になっていません | chrome://inspect/#remote-debugging を開き、有効にしてください |
| 「WebSocket 接続タイムアウト」 | CDP プロキシが接続を保持しています | スクリプトは自動的にプロキシ API にフォールバックします |
| 空白/白いスクリーンショット | ページがまだ読み込まれていません | --wait の値を増やしてください |
| 下部で切り詰められる | スクロールコンテナが展開されていません | スクリプトが自動的に処理します。問題が続く場合は、issue を提出してください |
| メモリ不足 | 非常に長いページ + 高い DPR | --dpr を 1 に減らすか、--width を減らしてください |
| 「PIL が結合に利用できません」 | Python Pillow がインストールされていません | pip3 install Pillow でインストールするか、個別のタイルファイルを受け入れてください |
相互参照
engineering/browser-automation— CDP/Playwright を介した一般的なブラウザ自動化パターンengineering/performance-profiler— 視覚的なキャプチャを補完する可能性のあるパフォーマンス分析
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Full Page Screenshot
Capture a full-page screenshot of any web page via Chrome DevTools Protocol. Produces a single PNG that includes all content — even portions that require scrolling. Zero external dependencies beyond Node.js 22+ and Chrome with remote debugging enabled.
Prerequisites
- Node.js 22+ (uses built-in
WebSocket) - Chrome/Chromium with remote debugging enabled
Check environment readiness:
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" --check
If Chrome check fails, instruct user to open chrome://inspect/#remote-debugging and enable "Allow remote debugging for this browser instance".
Workflow
Option A: Screenshot an already-open tab (recommended for authenticated pages)
- List available tabs:
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" --list
- Identify the target by title/URL, then capture:
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" <targetId> /tmp/screenshot.png --width 1200 --dpr 1
Option B: Screenshot a URL (opens a background tab, captures, closes)
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" --url "https://example.com" /tmp/screenshot.png --width 1200 --dpr 1 --wait 15000
Note:
--urlmode creates a background tab. Pages requiring authentication (SSO, login walls) should use Option A instead.
Parameters
| Parameter | Description | Default |
|---|---|---|
output |
Output PNG file path | /tmp/screenshot.png |
--width |
Viewport width in CSS pixels (articles: 1200, dashboards: 1440-1920) | 1200 |
--dpr |
Device pixel ratio (2 = Retina, but 4x file size) | 1 |
--wait |
Page load timeout in ms (--url mode only) |
15000 |
--css |
Custom CSS to inject before capture (e.g., hide elements) | — |
Verify Output
# macOS
sips -g pixelWidth -g pixelHeight /tmp/screenshot.png
# Linux
file /tmp/screenshot.png
Core Capabilities
-
SPA scroll container expansion — Detects
overflow-y: auto/scrollcontainers, scrolls through them to trigger lazy-loading, then removes overflow constraints (including Tailwindh-[calc(...)]) so all content renders in a single pass. -
DOM stability detection — After
readyState=complete, monitors DOM element count until it stabilizes. This ensures SPA frameworks finish rendering dynamic content. -
Lazy-load triggering — Scrolls the viewport incrementally to fire
IntersectionObservercallbacks, then waits for all<img>elements to complete loading. -
Tiled capture for very tall pages — Pages exceeding 16,000px are captured in 8,000px tiles and automatically stitched using Python PIL. Falls back to saving tiles separately if PIL is unavailable.
-
Auto-discovery of Chrome — Reads
DevToolsActivePortfile to find the debugging port. Falls back to probing ports 9222, 9229, 9333. -
CDP Proxy fallback — When a CDP proxy holds the browser WebSocket, the script falls back to proxy API endpoints (
/eval,/screenshot,/scroll) for capture.
How It Works
1. Discover Chrome debugging port
2. Connect via WebSocket (CDP)
3. Attach to target / create background tab
4. Set viewport width via Emulation domain
5. Wait: readyState + DOM stability
6. Detect & expand scroll containers
7. Scroll through page (trigger lazy-load)
8. Wait for images to complete
9. Measure final content height
10. Page.captureScreenshot (or tiled capture)
11. Stitch tiles if needed (PIL)
12. Restore viewport, detach, clean up
Anti-Patterns
| Do NOT | Do instead |
|---|---|
Use --dpr 2 on pages > 10,000px tall |
Use --dpr 1 to avoid Chrome memory issues |
Use --url for authenticated/SSO pages |
Use --list + targetId on a tab where user is logged in |
Set --wait below 5000 for SPAs |
SPAs need time to fetch data and render; use 10000-15000 |
Capture without checking --check first |
Always verify Chrome debugging is available |
| Hardcode viewport widths for all pages | Use 1200 for articles, 1440+ for dashboards/tables |
| Skip output verification | Always verify with sips or file command after capture |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "Cannot find Chrome debugging port" | Remote debugging not enabled | Open chrome://inspect/#remote-debugging, enable it |
| "WebSocket connection timeout" | CDP proxy holding the connection | Script auto-falls back to proxy API |
| Blank/white screenshot | Page not loaded yet | Increase --wait value |
| Truncated at bottom | Scroll container not expanded | Script handles this automatically; file an issue if it persists |
| Out of memory | Very tall page + high DPR | Reduce --dpr to 1 and/or reduce --width |
| "PIL not available for stitching" | Python Pillow not installed | Install with pip3 install Pillow or accept separate tile files |
Cross-References
engineering/browser-automation— General browser automation patterns via CDP/Playwrightengineering/performance-profiler— Performance analysis that may complement visual captures
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (5,508 bytes)
- 📎 scripts/full-page-screenshot.mjs (35,910 bytes)