SKILL·DCBA8E

full-page-screenshot

LewisLiu007
更新于 1 month ago
9 次查看
8
8
在 GitHub 上查看
其他general

关于

This skill captures full-page screenshots of web pages as PNG images, handling both open browser tabs and specified URLs. It automatically manages SPA scroll containers, lazy-loaded images, and stitches together long pages. The tool connects directly to Chrome DevTools Protocol without external dependencies.

快速安装

Claude Code

推荐
主要方式
npx skills add LewisLiu007/full-page-screenshot -a claude-code
插件命令备选方式
/plugin add https://github.com/LewisLiu007/full-page-screenshot
Git 克隆备选方式
git clone https://github.com/LewisLiu007/full-page-screenshot.git ~/.claude/skills/full-page-screenshot

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Full Page Screenshot

对浏览器中的网页生成一张完整的长截图 PNG,覆盖页面全部内容(包括需要滚动才能看到的部分)。直连 Chrome DevTools WebSocket,无需 CDP Proxy 或其他中间层。

前置条件

只需 Node.js 22+ 和 Chrome 开启远程调试:

node "${CLAUDE_SKILL_DIR}/scripts/full-page-screenshot.mjs" --check

如果 chrome 检查失败,引导用户:打开 chrome://inspect/#remote-debugging,勾选 "Allow remote debugging for this browser instance"

工作流程

用户描述了已打开的 tab(推荐,尤其是需要登录的页面)

先列出所有 tab,匹配用户描述找到 targetId

node "${CLAUDE_SKILL_DIR}/scripts/full-page-screenshot.mjs" --list

然后截图该 tab:

node "${CLAUDE_SKILL_DIR}/scripts/full-page-screenshot.mjs" <targetId> <output> [--width N] [--dpr N]

用户给了 URL

一条命令完成全部流程(建 tab → 等加载 → 截图 → 关 tab):

node "${CLAUDE_SKILL_DIR}/scripts/full-page-screenshot.mjs" --url "<URL>" <output> [--width N] [--dpr N] [--wait N]

注意--url 模式创建后台 tab。对于需要登录的内部系统(如 SAP、企业 SSO),后台 tab 可能无法完成认证。此时应引导用户先在 Chrome 中打开页面,然后使用 targetId 模式截图。

参数说明

参数说明默认值
output输出文件路径/tmp/screenshot.png
--width视口宽度(CSS 像素)。文章页 1200,宽表格/面板 1440-19201200
--dpr设备像素比。2 可获 Retina 清晰度,但体积翻 4 倍1
--wait页面加载超时(毫秒),仅 --url 模式15000

验证输出

sips -g pixelWidth -g pixelHeight <output>

裁剪局部验证(需要 Pillow):

from PIL import Image
img = Image.open("<output>")
w, h = img.size
img.crop((0, 0, w, 1500)).save("/tmp/check_top.png")
img.crop((0, h-1500, w, h)).save("/tmp/check_bottom.png")

核心能力

  • SPA 内部滚动容器:自动检测 overflow-y: auto/scroll 的容器,用 !important 覆盖 CSS 高度约束(含 Tailwind h-[calc(...)] 等),展开全部内容后截图
  • DOM 稳定等待readyState=complete 后继续监测 DOM 元素数量变化,直到 SPA 数据渲染完成
  • 懒加载处理:逐步滚动触发 IntersectionObserver,等待所有 img.complete
  • 超长页面分片:>16000px 的页面自动分片截取(每片 8000px),用 Python PIL 拼接
  • Proxy 兼容:当 web-access CDP Proxy 运行时,自动检测并通过 proxy API 完成截图(滚动容器分片拼接)

注意事项

  • 超长页面(> 20000px)在高 DPR 下可能导致 Chrome 内存问题。遇到此情况降低 --dpr 到 1 或减小 --width
  • --url 模式会自动创建后台 tab 并在截图后关闭,不影响用户已有 tab。
  • 截图期间会临时改变页面视口尺寸和滚动容器样式,完成后自动恢复。
  • 脚本通过读取 DevToolsActivePort 文件发现 Chrome 调试端口,直连 WebSocket,无需任何代理或中间服务。
  • 分片拼接需要 Python 3 + Pillow(macOS 通常已安装)。无 Pillow 时会保留分片文件。
  • 当 web-access 的 CDP Proxy 在运行时,脚本先尝试直连,超时后降级到 proxy API(通过 /eval 和 /screenshot 端点操作)。

GitHub 仓库

LewisLiu007/full-page-screenshot
路径: SKILL.md
0
cdpchrome-devtoolsclaude-codeclaude-code-skillfull-page-screenshotscreenshot
FAQ

Frequently asked questions

What is the full-page-screenshot skill?

full-page-screenshot is a Claude Skill by LewisLiu007. Skills package instructions and resources that Claude loads on demand, so Claude can perform full-page-screenshot-related tasks without extra prompting.

How do I install full-page-screenshot?

Use the install commands on this page: add full-page-screenshot to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does full-page-screenshot belong to?

full-page-screenshot is in the Other category, tagged general.

Is full-page-screenshot free to use?

Yes. full-page-screenshot is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.

相关推荐技能

llamaguard
其他

LlamaGuard是Meta推出的7-8B参数内容审核模型,专门用于过滤LLM的输入和输出内容。它能检测六大安全风险类别(暴力/仇恨、性内容、武器、违禁品、自残、犯罪计划),准确率达94-95%。开发者可通过HuggingFace、vLLM或Sagemaker快速部署,并能与NeMo Guardrails集成实现自动化安全防护。

查看技能
cost-optimization
其他

这个Claude Skill帮助开发者优化云成本,通过资源调整、标记策略和预留实例来降低AWS、Azure和GCP的开支。它适用于减少云支出、分析基础设施成本或实施成本治理策略的场景。关键功能包括提供成本可视化、资源规模调整指导和定价模型优化建议。

查看技能
sports-betting-analyzer
其他

该Skill为开发者提供体育博彩数据分析工具,可分析盘口、大小球和特殊投注,识别价值投注机会。它整合历史数据和情景统计,生成包含时间戳的结构化Markdown报告。适用于需要快速获取博彩市场洞察的娱乐或教育类应用开发。

查看技能
quantizing-models-bitsandbytes
其他

这个Skill使用bitsandbytes库量化大语言模型,能在GPU内存有限时通过8位或4位量化减少50-75%内存占用,同时保持精度损失最小。它支持INT8、NF4、FP4等多种量化格式,可与HuggingFace Transformers无缝集成,适用于需要部署更大模型或加速推理的场景。还提供QLoRA训练和8位优化器支持,让开发者能轻松实现高效模型压缩。

查看技能