// ==UserScript== // @name 稿定设计PS专业版 - 去除登录弹窗 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 自动移除稿定设计PS专业版(www.gaoding.com/editor/ps)的登录弹窗和遮罩,无需登录即可使用编辑器。 // @author 阚泥 // @match *://www.gaoding.com/editor/ps* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const DIALOG_SELECTOR = '.g-dialog__wrapper.g-dialog__wrapper--centered'; const MASK_SELECTOR = '.gd-mask'; function removeLoginOverlay() { const dialog = document.querySelector(DIALOG_SELECTOR); if (dialog && dialog.parentNode) { dialog.parentNode.removeChild(dialog); console.log('[稿定PS] 已移除登录弹窗'); } const mask = document.querySelector(MASK_SELECTOR); if (mask && mask.parentNode) { mask.parentNode.removeChild(mask); console.log('[稿定PS] 已移除遮罩层'); } } if (document.readyState === 'complete' || document.readyState === 'interactive') { removeLoginOverlay(); } else { document.addEventListener('DOMContentLoaded', removeLoginOverlay); } const observer = new MutationObserver(function(mutations) { for (const mutation of mutations) { if (mutation.type === 'childList') { for (const node of mutation.addedNodes) { if (node.nodeType === Node.ELEMENT_NODE) { const isDialog = node.matches && node.matches(DIALOG_SELECTOR); const isMask = node.matches && node.matches(MASK_SELECTOR); const containsDialog = node.querySelector && node.querySelector(DIALOG_SELECTOR); const containsMask = node.querySelector && node.querySelector(MASK_SELECTOR); if (isDialog || isMask || containsDialog || containsMask) { removeLoginOverlay(); break; } } } } } }); observer.observe(document.body, { childList: true, subtree: true }); window.addEventListener('load', function() { setTimeout(removeLoginOverlay, 500); }); })();