$('.avatar').each(function (){
var href = $(this).attr('href');
//let match = href.match(/(\d+)/);
//let ID = match ? match[1].toString() : "none";
if(typeof href == "string"){
//console.log(href)
let match = href.match(/user\/([a-zA-Z0-9]+)/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID)){
$(this.parentNode).hide();
}
}
})
(function() {
let blacklist;
if(localStorage.getItem('bangumi_user_blacklist'))
blacklist = JSON.parse(localStorage.getItem('bangumi_user_blacklist'));
else
blacklist = [];
$('.avatarNeue').each(function (){
let match = this.style.backgroundImage.match(/(\d+)\.jpg/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID))
$(this.parentNode.parentNode).hide();
})
//------------------
//此处为新增加内容
$('.avatar_mn').each(function (){
let match = this.getAttribute("src").match(/(\d+)\.jpg/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID))
$(this.parentNode.parentNode).hide();
})
//------------------
//设置
if(document.location.href.match(/settings\/privacy/)){
blacklist = [];
$('a').each(function (){
let match = this.href.match(/(\d+)&gh/);
let ID = match ? match[1].toString() : null;
if(ID){
blacklist.push(ID);
localStorage.setItem('bangumi_user_blacklist',JSON.stringify(blacklist));
}
})
}
})();
(function() {
let blacklist;
if(localStorage.getItem('bangumi_user_blacklist'))
blacklist = JSON.parse(localStorage.getItem('bangumi_user_blacklist'));
else
blacklist = [];
$('.avatarNeue').each(function (){
let match = this.style.backgroundImage.match(/(\d+)\.jpg/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID)) {
$(this.parentNode.parentNode).hide();
}
});
//------------------
//此处为新增加内容
$('.avatar_mn').each(function (){
let match = this.getAttribute("src").match(/(\d+)\.jpg/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID)) {
$(this.parentNode.parentNode).hide();
}
})
$('.avatar.ll').each(function (){
let match = this.getAttribute("src").match(/(\d+)\.jpg/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID)) {
$(this.parentNode.parentNode.parentNode).hide();
}
})
$('.avatarNeue').each(function() {
let ID = this.getAttribute("data-user");
if(blacklist.includes(ID)) {
$(this.parentNode.parentNode).hide();
}
})
$('.avatar_mn.ll').each(function (){
let ID = this.getAttribute("data-user");
if(blacklist.includes(ID)) {
$(this.parentNode.parentNode).hide();
}
})
$('.postTopic > a').each(function() {
let match = this.getAttribute("href").match(/user\/(\d+)/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID)) {
$(this.parentNode).hide();
}
})
$('.row_reply > a').each(function() {
let match = this.getAttribute("href").match(/user\/(\d+)/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID)) {
$(this.parentNode).hide();
}
})
$('.sub_reply_bg > a').each(function() {
let match = this.getAttribute("href").match(/user\/(\d+)/);
let ID = match ? match[1].toString() : null;
if(blacklist.includes(ID)) {
$(this.parentNode.parentNode).hide();
}
})
//------------------
//设置
if(document.location.href.match(/settings\/privacy/)){
blacklist = [];
$('a').each(function (){
let match = this.href.match(/(\d+)&gh/);
let ID = match ? match[1].toString() : null;
if(ID){
blacklist.push(ID);
localStorage.setItem('bangumi_user_blacklist',JSON.stringify(blacklist));
}
})
}
})();
改成
就行了
你可以把所有引用一起屏蔽掉 我记得有相关组件
屏蔽首页帖子的 我写了一个针对标题的组件
那可以屏蔽贴子吗 不太想看无意义无营养垃圾贴 看到了总想点进去看看 ( 就是贱
然后点击LZ发的链接就可以自动安装了。
修改代码的话,就在油猴的管理面板里面进行
我手动改过了