NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
Wallhaven 快速下载脚本:在列表页悬停壁纸卡片时快速预览,一键下载原图,并在下载后尝试自动标记为已看。
GM_download 下载原图。…,下载成功后短暂显示 ✓,随后恢复为可再次点击的下载按钮。使用 Tampermonkey、Violentmonkey 等用户脚本管理器安装 main.js。
脚本匹配范围:
https://wallhaven.cc/*
3840 x 2160。脚本使用原生 DOM API、MutationObserver、GM_xmlhttpRequest 和 GM_download。主要流程如下:
MutationObserver 监听列表页卡片变化,并为壁纸卡片注入工具按钮。.wall-res 节点读取分辨率,并显示在预览图底部。#wallpaper 元素解析真实地址。本项目没有构建步骤。修改脚本后至少运行:
node --check main.js
node tests/preview-behavior.test.js
node tests/resource-lifecycle.test.js
node --check 只检查 JavaScript 语法,不会验证浏览器环境、用户脚本 API 或 Wallhaven 页面行为。涉及交互变化时,还需要在 Tampermonkey 或 Violentmonkey 中手动验证。
MIT
Rating: 0