去除开源中国乱弹中用户的特殊标签
// ==UserScript==
// @name 开源中国去用户标签
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 去除开源中国乱弹中用户的特殊标签
// @author MYL
// @match https://**.oschina.net/**
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
removeUserLabel();
document.getElementById("tweetList").addEventListener('DOMNodeInserted', function(e) {
removeUserLabel();
});
})();
/*去除标签的方法*/
function removeUserLabel(){
console.log("开始执行去标签脚本");
var list=document.getElementsByClassName("__user");
for(var i=0; i<list.length; i++){
// console.log(list[i].text);
var item = list[i].parentNode.getElementsByTagName("span")
for(var j=0; j<item.length; j++){
// class=memo表示不是标签
if (item[j].getAttribute("class")!="memo"){
console.log(list[i].text + "标签长度" + item.length + "获取到了标签:" + item[j]);
item[j].remove();
--j;
}
}
}
console.log("结束执行去标签脚本");
}
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址