SHARE
TWEET

Untitled

a guest Mar 26th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         p0T Uploadfilter
  3. // @namespace    http://http://forum.mods.de
  4. // @version      0.1
  5. // @author       yep
  6. // @match        http://forum.mods.de/bb/thread.php*
  7. // @grant        none
  8. // ==/UserScript==
  9.  
  10. (function () {
  11.     'use strict';
  12.     //Konfiguration:
  13.     var filter = [];
  14.     filter.push("Immortalized");
  15.  
  16.     //Code
  17.     let userElements = getAllElementsWithAttribute("username");
  18.     userElements.forEach(element => {
  19.         filter.forEach(filterItem => {
  20.             if (element.getAttribute("username") == encodeURI(filterItem)) {
  21.                 element.remove();
  22.             }
  23.         });
  24.     });
  25.  
  26. })();
  27.  
  28.  
  29. function getAllElementsWithAttribute(attribute) {
  30.     var matchingElements = [];
  31.     var allElements = document.getElementsByTagName('*');
  32.     for (var i = 0, n = allElements.length; i < n; i++) {
  33.         if (allElements[i].getAttribute(attribute) !== null) {
  34.             // Element exists with attribute. Add to array.
  35.             matchingElements.push(allElements[i]);
  36.         }
  37.     }
  38.     return matchingElements;
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top