// ==UserScript== // @name 去除水印(新) + 清屏恢复 // @namespace http://tampermonkey.net/ // @version 2025.12.29 // @description 在线设计去除水印 + 一键清屏/恢复。支持稿定设计、图怪兽、图司机、包图网、千图网、创客贴、比格设计、魔力设、觅知网。 // @author Shuaima + 清屏功能集成 // @match *://*.gaoding.com/* // @match *://*.818ps.com/* // @match *://*.tusij.com/* // @match *://*.ibaotu.com/* // @match *://*.58pic.com/* // @match *://*.chuangkit.com/* // @match *://bigesj.com/* // @match *://*.molishe.com/* // @match *://*.51miz.com/* // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; // 按钮样式 const buttonStyle = ` position: fixed; top: 10px; left: 50%; transform: translateX(40%); width: 80px; height: 40px; background: linear-gradient(90deg, rgb(255 102 68), rgb(255 102 68)); border-radius: 5px; color: #fff; font-size: 14px; font-weight: 500; text-align: center; cursor: pointer; z-index: 99999; box-shadow: 0 0 4px rgba(0,0,0,0.15); border: none; outline: none; margin-left: 90px; `; // 清屏按钮样式 const clearScreenBtnStyle = ` position: fixed; top: 10px; left: 50%; transform: translateX(40%); width: 80px; height: 40px; background: #00a700; border-radius: 5px; color: #fff; font-size: 14px; font-weight: 500; text-align: center; cursor: pointer; z-index: 99999; box-shadow: 0 0 4px rgba(0,0,0,0.15); border: none; outline: none; `; let isScreenCleared = false; // 清屏状态 // 添加去水印按钮 function addButton() { const button = document.createElement('button'); button.textContent = '去水印'; button.style.cssText = buttonStyle; button.addEventListener('click', removeWatermark); document.body.appendChild(button); } // 添加清屏按钮 function addClearScreenButton() { const btn = document.createElement('button'); btn.textContent = '清屏'; btn.style.cssText = clearScreenBtnStyle; btn.addEventListener('click', toggleClearScreen); document.body.appendChild(btn); } // 清屏 / 恢复 切换(完全适配截图里的图怪兽界面) function toggleClearScreen() { // 根据截图识别的图怪兽核心面板选择器 const tgSMonsterSelectors = [ // 左侧功能面板(添加/模板/素材等) '.editor-left-panel', '.left-operation-panel', // 右侧设置面板 '.editor-right-panel', '.setting-panel', // 顶部操作栏(企业会员/下载等) '.editor-top-bar', '.top-operation-bar', // 底部缩放栏 '.editor-bottom-zoom', '.zoom-control', // 兜底匹配(按截图视觉补充) '[class*="left"]', '[class*="right"]', '[class*="panel"]', '[class*="bar"]', '[class*="operation"]' ]; // 通用面板 + 图怪兽专属面板 const elements = [ // 通用网站面板 ...document.querySelectorAll('.resource-station, .right-panel, .main__bottom, .dui-noob-guide-index'), ...document.querySelectorAll('.left-side, .right-side, .footer, .header, .toolbar, .sidebar, .nav, .menu'), // 图怪兽精准匹配 ...document.querySelectorAll(tgSMonsterSelectors.join(',')) ]; if (!isScreenCleared) { // 隐藏面板(用visibility兼容display无效的情况) elements.forEach(el => { if (el) { el.style.display = 'none'; el.style.visibility = 'hidden'; el.style.opacity = '0'; } }); this.textContent = '恢复'; } else { // 恢复面板 elements.forEach(el => { if (el) { el.style.display = ''; el.style.visibility = ''; el.style.opacity = ''; } }); this.textContent = '清屏'; } isScreenCleared = !isScreenCleared; } // 拦截 SVG 水印 function interceptSvgWatermark(prototype, svgBase64) { const originalSetSrc = Object.getOwnPropertyDescriptor(prototype, 'src').set; Object.defineProperty(prototype, 'src', { set(value) { if (value.startsWith(svgBase64)) { console.log('Intercepted SVG:', value); return; } originalSetSrc.call(this, value); } }); } // 去除水印逻辑 function removeWatermark() { const host = window.location.hostname; // 千图网、包图网、图司机 if (host.includes('58pic') || host.includes('ibaotu') || host.includes('tusij')) { document.querySelectorAll('.image-watermark').forEach(element => element.remove()); } // 稿定设计 else if (host.includes('gaoding.com')) { interceptSvgWatermark(HTMLImageElement.prototype, 'data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjMwMCIgaGVpZ'); const originalCreateObjectURL = URL.createObjectURL; URL.createObjectURL = function(blob) { if (blob && blob.type === 'image/svg+xml') { console.log('Blocked SVG blob:', blob); return ''; } return originalCreateObjectURL.call(this, blob); }; } // 图怪兽 else if (host.includes('818ps.com')) { interceptSvgWatermark(HTMLImageElement.prototype, 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy'); } // 创客贴 else if (host.includes('chuangkit')) { document.querySelector('.remove-cktTemplate-watermark')?.remove(); const canvasSlotItem = document.querySelector('.canvas-slot-item'); if (canvasSlotItem) { canvasSlotItem.style.zIndex = '99999'; canvasSlotItem.style.position = 'absolute'; } } // 比格设计 else if (host.includes('bigesj')) { document.querySelectorAll('.water, .water-tip').forEach(element => element.remove()); } // 魔力设 else if (host.includes('molishe')) { const elements = document.querySelectorAll('div.sc-cSiAOC'); elements.forEach(element => element.remove()); } // 觅知网 else if (host.includes('51miz')) { const iframe = document.getElementById('editor-online'); if (iframe) { window.open(iframe.src, '_self'); } } } // 自动加载按钮(延迟加载适配图怪兽异步渲染) window.addEventListener('load', () => { setTimeout(() => { addButton(); // 去水印按钮 addClearScreenButton(); // 清屏按钮 }, 2000); }); // 自动去水印 if (location.href.includes('gaoding.com') || location.href.includes('818ps.com')) { removeWatermark(); } })();