// ==UserScript==
// @name 祛除C创K可T贴水印去除
// @namespace your-namespace
// @version 1.0
// @description 移除指定创可贴设计个人草稿设计作品的水印标签
// @author missjhf,仅供学习交流,请支持原创。
// @match https://www.chuangkit.com/odyssey/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function removeWatermark() {
// 获取具有指定类的 div 元素
var watermarkDivs = document.querySelectorAll('.remove-cktTemplate-watermark');
watermarkDivs.forEach(function(watermarkDiv) {
// 创建注释节点
var commentNode = document.createComment('This div has been commented.');
// 替换原始 div 元素
watermarkDiv.parentNode.replaceChild(commentNode, watermarkDiv);
// 获取具有两个类的 div 元素
var divElement = document.querySelector('div.canvas.water-mark');
if (divElement) {
// 弹出对话框获取用户输入
var userInput = prompt('获取免费解锁码→❤关注公众号❤:jimeizy,回复关键词:CKT');
if (userInput === null || userInput.trim() === '') {
alert('请刷新本页面重新祛除水印。');
return;
}
if (userInput) {
// 删除 div 元素的 class 属性
divElement.removeAttribute(userInput);
// 创建注释节点
var commentNode2 = document.createComment('This div has been commenteded.');
// 替换原始 div 元素
divElement.parentNode.replaceChild(commentNode2, divElement);
}
}
});
}
function addButton() {
// 创建按钮元素
var button = document.createElement('button');
button.textContent = '祛除水印';
// 设置按钮样式
button.style.position = 'fixed';
button.style.top = '80px';
button.style.right = '120px';
button.style.zIndex = '9999';
button.style.backgroundColor = 'orange'; // 设置按钮背景颜色
// 添加点击事件处理程序
button.addEventListener('click', removeWatermark);
// 将按钮插入页面
document.body.appendChild(button);
}
// 在页面加载完成后运行脚本
window.addEventListener('load', addButton);
})();