maak security.nl minder irritant
This commit is contained in:
parent
7d36791118
commit
d80a24aeaa
1 changed files with 40 additions and 0 deletions
40
greasemonkey/securitynl_comments_remo.user.js
Normal file
40
greasemonkey/securitynl_comments_remo.user.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// ==UserScript==
|
||||
// @name Security.nl comments remover
|
||||
// @namespace http://www.security.nl
|
||||
// @description laat de idioten weg
|
||||
// @include http://www.security.nl/*
|
||||
// ==/UserScript==
|
||||
|
||||
|
||||
function $$(xpath,root) {
|
||||
xpath = xpath
|
||||
.replace(/((^|\|)\s*)([^/|\s]+)/g,'$2.//$3')
|
||||
.replace(/\.([\w-]+)(?!([^\]]*]))/g, '[@class="$1" or @class$=" $1" or @class^="$1 " or @class~=" $1 "]')
|
||||
.replace(/#([\w-]+)/g, '[@id="$1"]')
|
||||
.replace(/\/\[/g,'/*[');
|
||||
str = '(@\\w+|"[^"]*"|\'[^\']*\')';
|
||||
xpath = xpath
|
||||
.replace(new RegExp(str+'\\s*~=\\s*'+str,'g'), 'contains($1,$2)')
|
||||
.replace(new RegExp(str+'\\s*\\^=\\s*'+str,'g'), 'starts-with($1,$2)')
|
||||
.replace(new RegExp(str+'\\s*\\$=\\s*'+str,'g'), 'substring($1,string-length($1)-string-length($2)+1)=$2');
|
||||
var got = document.evaluate(xpath, root||document, null, 5, null), result=[];
|
||||
while (next = got.iterateNext())
|
||||
result.push(next);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//GM_log("script aangeroepen");
|
||||
$$('div[@class ^= "comments discussie"]').forEach(function (a) {
|
||||
a.parentNode.removeChild(a);
|
||||
// GM_log("remove one");
|
||||
});
|
||||
$$('div[@class ^= "comment discussie"]').forEach(function (a) {
|
||||
a.parentNode.removeChild(a);
|
||||
// GM_log("remove one");
|
||||
});
|
||||
$$('div[@class ^= "respond discussie"]').forEach(function (a) {
|
||||
a.parentNode.removeChild(a);
|
||||
// GM_log("remove one");
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue