-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzhihuBlockUsers.js
35 lines (32 loc) · 1.01 KB
/
zhihuBlockUsers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// ==UserScript==
// @name 知乎屏蔽用户
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author MeursaulT
// @match https://www.zhihu.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 将想要屏蔽的用户写入userList即可
var userList = ['立党','苏莉安']
var answers = document.getElementsByClassName('ContentItem AnswerItem')
function deleteAns(){
for(var i = 0 ; i < answers.length ; i++){
for(var user of userList){
if(answers[i].dataset.zop.includes(user)){
answers[i].remove()
}
}
}
}
(function(open) {
XMLHttpRequest.prototype.open = function() {
this.addEventListener("readystatechange", function() {
deleteAns();
}, false);
open.apply(this, arguments);
};
})(XMLHttpRequest.prototype.open);
})();