Chuyển đến nội dung
Skillpedia
Kiểm thử29k · #9587

full-page-screenshot

Skill này làm gì

Skill này chụp ảnh màn hình toàn trang dài của một trang web, kể cả trang rất dài hoặc phải cuộn. Skill dành cho những ai cần lưu hoặc chia sẻ cách một trang hiển thị trọn vẹn.

Khi nào nên dùng

  • ✓Khi bạn cần một bức ảnh của toàn bộ trang web, không chỉ phần đang hiện trên màn hình.
  • ✓Khi một trang tải ảnh khi bạn cuộn và bạn muốn có tất cả trong một lần chụp.
  • ✓Khi bạn muốn chụp một trang mà bạn đã đăng nhập sẵn trong Chrome.

Liên kết skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/full-page-screenshot/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/full-page-screenshot/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chụp ảnh toàn trang của website này và lưu thành file PNG.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Nó kết nối với Chrome qua giao diện gỡ lỗi, đo chiều cao đầy đủ của trang và lưu mọi thứ thành một ảnh duy nhất.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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)

  1. List available tabs:
node "${SKILL_DIR}/scripts/full-page-screenshot.mjs" --list
  1. 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: --url mode 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

  1. SPA scroll container expansion — Detects overflow-y: auto/scroll containers, scrolls through them to trigger lazy-loading, then removes overflow constraints (including Tailwind h-[calc(...)]) so all content renders in a single pass.

  2. DOM stability detection — After readyState=complete, monitors DOM element count until it stabilizes. This ensures SPA frameworks finish rendering dynamic content.

  3. Lazy-load triggering — Scrolls the viewport incrementally to fire IntersectionObserver callbacks, then waits for all <img> elements to complete loading.

  4. 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.

  5. Auto-discovery of Chrome — Reads DevToolsActivePort file to find the debugging port. Falls back to probing ports 9222, 9229, 9333.

  6. 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 scr
Câu hỏi thường gặp

Tôi có cần cài thêm gì để dùng không?

Cần Node.js 22 trở lên và Chrome với remote debugging được bật. Không cần tiện ích nào khác.

Nó có chụp được trang sau đăng nhập không?

Có, nếu bạn dùng một tab đã mở sẵn trong Chrome, vì nó tái sử dụng phiên đăng nhập hiện có.

Nếu Chrome chưa sẵn sàng thì sao?

Skill có một bước kiểm tra, sẽ bảo bạn bật remote debugging trong Chrome rồi thử lại.

Chi tiết

Mô tả gốc của tác giả

Use when asked for a full-page or long screenshot of a web page. Captures SPA scroll containers, lazy images and very tall pages through Chrome DevTools Protocol with no extra dependencies.

repo: alirezarezvani/claude-skills

Độ phổ biến

Sao GitHub
29k
Vị trí xếp hạng
#9587
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự