您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
站酷网图片辅助下载工具
// ==UserScript== // @name 站酷网作品原图查看 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 站酷网图片辅助下载工具 // @author You // @match *://www.zcool.com.cn/* // @grant GM_openInTab // @license MIT // ==/UserScript== (function() { 'use strict'; // 方式1:为所有图片添加右键保存功能 document.addEventListener('contextmenu', function(e) { if (e.target.tagName === 'IMG') { e.stopPropagation(); } }, true); // 方式2:创建图片查看器按钮 function addDownloadButtons() { const images = document.querySelectorAll('img.photoImage'); images.forEach(img => { if(!img.parentNode.querySelector('.zcool-helper-btn')) { const btn = document.createElement('button'); btn.className = 'zcool-helper-btn'; btn.textContent = '查看原图'; btn.style.position = 'absolute'; btn.style.zIndex = '9999'; btn.style.background = '#ff4e00'; btn.style.color = 'white'; btn.style.padding = '2px 5px'; btn.style.borderRadius = '3px'; btn.style.border = 'none'; btn.style.cursor = 'pointer'; btn.onclick = function() { const src = img.src.replace(/\/\/(.*?)\.zcool/, '//$1.zcool'); GM_openInTab(src, {active: true}); }; img.parentNode.style.position = 'relative'; img.parentNode.appendChild(btn); } }); } // 监听动态加载内容 const observer = new MutationObserver(addDownloadButtons); observer.observe(document.body, {childList: true, subtree: true}); // 初始执行 addDownloadButtons(); })();