Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Troll remover
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://diit.cz/clanek/*/diskuse
- // @match https://cdr.cz/clanek/*/diskuse
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var trolls = [
- 'JirkaK',
- 'ASClIIIl',
- 'RedMaX',
- 'ATITom'
- ];
- var trollsQuoted = trolls.map(name => '"'+name+'"');
- var trollsCondition = trollsQuoted.join(' or .=');
- function _x(STR_XPATH) {
- var xresult = document.evaluate(STR_XPATH, document, null, XPathResult.ANY_TYPE, null);
- var xnodes = [];
- var xres;
- while (xres = xresult.iterateNext()) {
- xnodes.push(xres);
- }
- return xnodes;
- }
- window.jQuery(_x('//*[contains(@class,"comment ") and contains(@class,"clearfix") and .//*[contains(@class,"username") and (.=' + trollsCondition + ')]]')).text('[Trollovina odfiltrována]');
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement