// ==UserScript==
// @name 豆包AI生图去水印(增强版) - 维度导航
// @namespace http://tampermonkey.net/
// @version 2.0.0
// @description 豆包AI生图下载原图去水印,现代化UI提示,后台无感替换原图链接。
// @author 维度导航
// @homepage https://www.weidus.com
// @match https://www.doubao.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=doubao.com
// @grant none
// @license GPL-3.0
// @downloadURL https://update.greasyfork.icu/scripts/575625/%E8%B1%86%E5%8C%85AI%E7%94%9F%E5%9B%BE%E5%8E%BB%E6%B0%B4%E5%8D%B0%EF%BC%88%E5%A2%9E%E5%BC%BA%E7%89%88%EF%BC%89%20-%20%E7%BB%B4%E5%BA%A6%E5%AF%BC%E8%88%AA.user.js
// @updateURL https://update.greasyfork.icu/scripts/575625/%E8%B1%86%E5%8C%85AI%E7%94%9F%E5%9B%BE%E5%8E%BB%E6%B0%B4%E5%8D%B0%EF%BC%88%E5%A2%9E%E5%BC%BA%E7%89%88%EF%BC%89%20-%20%E7%BB%B4%E5%BA%A6%E5%AF%BC%E8%88%AA.meta.js
// ==/UserScript==
(function() {
'use strict';
const UIManager = {
container: null,
toastTimer: null,
init() {
const style = document.createElement('style');
style.textContent = `
.wd-toast-container {
position: fixed;
top: 24px;
right: 24px;
z-index: 999999;
display: flex;
flex-direction: column;
gap: 12px;
pointer-events: none;
}
.wd-toast {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 24px;
border-radius: 12px;
background: rgba(25, 28, 34, 0.85);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
color: #ffffff;
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 0.08);
transform: translateX(120%);
opacity: 0;
transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wd-toast.wd-show {
transform: translateX(0);
opacity: 1;
}
.wd-toast-icon {
font-size: 18px;
display: flex;
align-items: center;
justify-content: center;
}
`;
document.head.appendChild(style);
// 创建容器
this.container = document.createElement('div');
this.container.className = 'wd-toast-container';
document.body.appendChild(this.container);
},
showToast(message, icon = '✨', duration = 3000) {
if (!this.container) this.init();
const toast = document.createElement('div');
toast.className = 'wd-toast';
toast.innerHTML = `
${icon}
${message}
`;
this.container.appendChild(toast);
// 触发动画
requestAnimationFrame(() => {
toast.classList.add('wd-show');
});
// 定时移除
setTimeout(() => {
toast.classList.remove('wd-show');
setTimeout(() => {
if (this.container.contains(toast)) {
toast.remove();
}
}, 400); // 等待动画结束
}, duration);
},
debouncedSuccessToast() {
if (this.toastTimer) clearTimeout(this.toastTimer);
this.toastTimer = setTimeout(() => {
this.showToast('已为您解锁无水印原图', '✅', 3500);
}, 500);
}
};
function findAllKeysInJson(obj, targetKey) {
const results = [];
function search(current) {
if (current && typeof current === 'object') {
if (!Array.isArray(current) && Object.prototype.hasOwnProperty.call(current, targetKey)) {
results.push(current[targetKey]);
}
const items = Array.isArray(current) ? current : Object.values(current);
for (const item of items) {
search(item);
}
}
}
search(obj);
return results;
}
// 劫持 JSON.parse
const originalParse = JSON.parse;
JSON.parse = function(data) {
const jsonData = originalParse(data);
// 快速过滤非目标数据
if (typeof data !== 'string' || !data.includes('creations')) {
return jsonData;
}
try {
let isModified = false;
const creationsList = findAllKeysInJson(jsonData, 'creations');
if (creationsList.length > 0) {
creationsList.forEach(creations => {
if (Array.isArray(creations)) {
creations.forEach(item => {
if (item?.image?.image_ori_raw?.url) {
const rawUrl = item.image.image_ori_raw.url;
if (item.image.image_ori) item.image.image_ori.url = rawUrl;
if (item.image.image_preview) item.image.image_preview.url = rawUrl;
if (item.image.image_thumb) item.image.image_thumb.url = rawUrl;
isModified = true;
}
});
}
});
if (isModified) {
UIManager.debouncedSuccessToast();
}
}
} catch (error) {
console.error('维度导航去水印插件解析错误:', error);
}
return jsonData;
};
function onPageLoad() {
setTimeout(() => {
UIManager.showToast('维度导航:去水印引擎已就绪', '🚀', 4000);
console.log('🚀 [维度导航] 豆包AI去水印脚本已激活,开始静默监控请求...');
}, 1500);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', onPageLoad);
} else {
onPageLoad();
}
})();