// ==UserScript== // @name 去除水印(新) // @namespace http://tampermonkey.net/ // @version 2025.2.18 // @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: #7a4806; 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; `; // 添加去水印按钮 function addButton() { const button = document.createElement('button'); button.textContent = '去水印'; button.style.cssText = buttonStyle; button.addEventListener('click', removeWatermark); document.body.appendChild(button); } // 拦截 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'); } // 图怪兽 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')) { // sc-cSiAOC gFbDaS .fyzzoy const elements = document.querySelectorAll('div.sc-cSiAOC'); elements.forEach(element => { element.remove(); // 移除元素 }); } // 觅知网 注:觅知网iframe不是同源情况,引用的魔力设源,所以最后处理是魔力设处理。 else if (host.includes('51miz')) { // 获取 iframe 元素 const iframe = document.getElementById('editor-online'); if (iframe) { // 获取 iframe 的 src 属性 const iframeSrc = iframe.src; // 当前页面打开,魔力设处理, window.open(iframeSrc, '_self'); } else { console.warn('未找到 id 为 editor-online 的 iframe'); } } } if (window.location.href.includes('gaoding.com') || window.location.href.includes('818ps.com')) { removeWatermark(); } else { window.addEventListener('load', addButton); } })();