删除页面中所有元素的 'javascript-hide' 类名
// ==UserScript==
// @name 【555】
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 删除页面中所有元素的 'javascript-hide' 类名
// @author YourName
// @match https://yande.re/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
// 定义一个执行函数
const revealElements = () => {
// 找到所有带有 javascript-hide 类的元素
const hiddenElements = document.querySelectorAll('.javascript-hide');
hiddenElements.forEach(el => {
el.classList.remove('javascript-hide');
// 如果你希望更彻底一点,可以打印日志确认
// console.log('已显示隐藏元素:', el);
});
};
// 1. 页面加载完成后立即执行一次
revealElements();
// 2. 应对瀑布流加载(如果页面是动态加载内容的)
// 使用观察者模式实时监控 DOM 变化
const observer = new MutationObserver((mutations) => {
revealElements();
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();