// ==UserScript==// @name 去除水印(新)// ==/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'); 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')) { // sc-cSiAOC gFbDaS .fyzzoy 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) { 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); }})();