User:Walter Grassroot/no2.js
外观
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
// ==UserScript==
// @name 维基百科用户屏蔽工具
// @namespace https://github.com/Hyijun/wikipedia_cover
// @version 1.5.5
// @icon https://wikicn.playgoteam.workers.dev/favicon.ico
// @description 维基百科上的一个用户屏蔽工具,它能删除一些您不希望看到用户的留言
// @author Hyijun
// @license GNU
// @supportURL https://github.com/Hyijun/wikipedia_cover/issues
// @match *://wikicn.playgoteam.workers.dev/wiki/Wikipedia*
// @match *://wikicn.playgoteam.workers.dev/User_talk:*
// @match *://wikicn.playgoteam.workers.dev/User:*
// @match *://wikicn.playgoteam.workers.dev/*Talk*:*
// @match *://wikicn.playgoteam.workers.dev/Talk:*
// ==/UserScript==
//wiki_cover.js B1.0
//By Hyijun. 如有问题请联系作者:https://github.com/Hyijun/wikipedia_cover/issues
//将你需要屏蔽的用户写在这个数组中,以逗号(半角)分隔,名字用双引号(半角)包围起来,不需要User:前缀
//例子:var users = new Array("User1", "User2", "User3");
var users = new Array("Symplectopedia", "Hanteng", "Sysywjel", "PhiLiP", "Daniel J Zhao", "Liu116", "Martinoei", "淺藍雪", "Winertai", "Marvin 2009", "だ*ぜ", "啦啦啦巴拿马", "Wetrace", "UjuiUjuMandan", "诗琳童", "A1Cafel", "Suiseiseki", "虹易", "社会我佩奇", "KOKUYO", "AINH", "Billytanghh", "420peace", "和平奮鬥救地球", "Beta Lohman", "Wildcursive", "Mattc123456c", "Itw", "Kuon.Haku", "SickManWP", "Sanmosa", "SCP-2000", "Sunny00217", "人人生來平等", "Nightwayyyyy", "Streetdeck", "Matt_Zhuang", "CRHK128", "Ericliu1912", "Baycrest", "Milkypine", "StarryHome");
//如果您不熟悉js语言,请不要修改以下代码
var url = window.location.href;
var matre = /.*?wikicn.playgoteam.workers.dev\/wiki\/(Wikipedia.*?|User_talk:.*?|User:.*?|.*?Talk.*?:.*?|Talk:.*?)/img;
if (!matre.test(url)){
console.log("因为处于条目空间,屏蔽工具未运行。");
}else{
var res_1 = new Array();
console.log("屏蔽工具正在运行。");
var users_name = "";
for (each in users){
if (each != (users.length - 1)){
users_name = users_name + users[each] + "|";
}else{
users_name = users_name + users[each];
}
}
var s1 = document.getElementById("mw-content-text").innerHTML;
re1 = new RegExp("<(p|dd|li)>.*?User:(" + users_name +")[\\s\\S]*?</(p|dd|li)>", "igm");
s1 = document.getElementById("mw-content-text").innerHTML = s1.replace(re1, "<div>[🐷🐷🐷]</div>");
}