您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
鼠标悬停在ID附近,根据防伪码或用户名屏蔽
当前为
// ==UserScript== // @name 煎蛋屏蔽器 // @match https://jandan.net/treehole* // @match https://jandan.net/pic* // @match https://jandan.net/top* // @match https://jandan.net/qa* // @version 1.1 // @namespace https://github.com/zunpiau // @author 多巴胺 // @description 鼠标悬停在ID附近,根据防伪码或用户名屏蔽 // @grant GM_setValue // @grant GM_getValue // ==/UserScript== let authorIds = GM_getValue("防伪码列表") || {} let authorNames = GM_getValue("用户名列表") || {} const l = document.querySelector('ol.commentlist') l.querySelectorAll('li').forEach(e => { const authorElem = e.querySelector('.author') if (!authorElem) { return } const strong = authorElem.querySelector('strong') const authorId = strong.getAttribute('title').substr(4) const authorName = strong.innerText if (authorIds[authorId] || authorNames[authorName]) { l.removeChild(e) } else { const authorIdBtn = document.createElement('a') const authorNameBtn = document.createElement('a') authorIdBtn.setAttribute('style', 'display:none') authorIdBtn.innerText = '屏蔽防伪码' authorNameBtn.setAttribute('style', 'display:none') authorNameBtn.innerText = '屏蔽用户名' authorElem.addEventListener("mouseover", () => { authorIdBtn.setAttribute('style', '') authorNameBtn.setAttribute('style', '') }) authorElem.addEventListener("mouseleave", () => { authorIdBtn.setAttribute('style', 'display:none') authorNameBtn.setAttribute('style', 'display:none') }) authorIdBtn.addEventListener("click", () => { authorIds = GM_getValue("防伪码列表") || {} authorIds[authorId] = authorName GM_setValue("防伪码列表", authorIds) l.removeChild(e) }) authorNameBtn.addEventListener("click", () => { authorNames = GM_getValue("用户名列表") || {} authorNames[authorName] = authorId GM_setValue("用户名列表", authorNames) l.removeChild(e) }) authorElem.appendChild(document.createElement('br')) authorElem.appendChild(authorIdBtn) authorElem.appendChild(document.createElement('br')) authorElem.appendChild(authorNameBtn) } })