TEXT   133    225   2.57 KB

EQG Flag Hider (now with TFH and G5)

By AnonPPP
Created: 6th May 2021 12:37:08 PM
Modified: 7th May 2021 12:58:27 PM
flags userscript

  1. //This is a fork of a userscript from https://github.com/MaresOnMyFace/flag-hider
  2. //Apart from EQG Flags, Ive included TFH Flags, as well G5 Flags
  3. //This serves as a joint solution with https://ponepaste.org/4869 (Flag Filter for 4ChanX)
  4. //Friendship is Magic
  5. // ==UserScript==
  6. // @name     flag hider2
  7. // @version  6
  8. // @grant    none
  9. // @author       (You)
  10. // @match        *://boards.4channel.org/mlp*
  11. // @run-at       document-start
  12. // ==/UserScript==
  13.  
  14. var bad_flag_classes =
  15.     [
  16.          "bfl-eqs",
  17.          "bfl-eqt",
  18.          "bfl-son",
  19.          "bfl-ada",
  20.          "bfl-ab",
  21.          "bfl-eqa",
  22.          "bfl-eqf",
  23.          "bfl-eqp",
  24.          "bfl-eqr",
  25.          "bfl-eqi",
  26.          "bfl-era",
  27.          "bfl-tp",
  28.          "bfl-tfv",
  29.          "bfl-tft",
  30.          "bfl-tfs",
  31.          "bfl-tfp",
  32.          "bfl-tfo",
  33.          "bfl-tfa",
  34.          "bfl-ss",
  35.          "bfl-pp",
  36.          "bfl-iz",
  37.     ];
  38.  
  39. function checkAndDeleteAll() {
  40.     bad_flag_classes.map(evil => document.getElementsByClassName(evil)).forEach(function(els) {while (els.length>0) {els[0].remove()};});
  41. }
  42. function checkAndDeleteSingle(n) {
  43.     if (bad_flag_classes.some(function(evil) {return n.classList.contains(evil);})) {
  44.         n.remove();
  45.     }
  46. }
  47.  
  48. function installMutationObserver(root) {
  49.     if (!("MutationObserver" in window)) {
  50.         window.MutationObserver = window.WebKitMutationObserver || window.MozMutationObserver;
  51.     }
  52.     var observer = new MutationObserver(function (mutations) {
  53.         mutations.forEach(function(m) {
  54.             m.addedNodes.forEach(function(n){
  55.                 if(n.tagName == "SPAN") {
  56.                     checkAndDeleteSingle(n);
  57.                 }
  58.             });
  59.         });
  60.     });
  61.     observer.observe(root, {childList: true, subtree: true, attributes: true});
  62. }
  63. function installStupidObserver(dbUtilsProm,root) {
  64.     if (!("MutationObserver" in window)) {
  65.         window.MutationObserver = window.WebKitMutationObserver || window.MozMutationObserver;
  66.     }
  67.     var observer = new MutationObserver(function (mutations) {
  68.         mutations.forEach(function(m) {
  69.             m.addedNodes.forEach(function(n){if(n.tagName == "DIV") {
  70.                     n.querySelectorAll("span").forEach(function(node) {checkAndDeleteSingle(node);});
  71.                 }
  72.             });
  73.         });
  74.     });
  75.     observer.observe(document, {childList: true, subtree: true, attributes: true});
  76. }
  77.  
  78. //dom parser
  79. checkAndDeleteAll();
  80. //4chan x
  81. installMutationObserver(document);
  82. //4chan native
  83. window.setTimeout(function() { installStupidObserver(); }, 100);

A Joint Collection of (almost) all MD5 Image Hashes (EQG)

by AnonPPP

Flag Filter (4ChanX)

by AnonPPP

EQG Flag Hider (now with TFH and G5)

by AnonPPP

Pony Flags All ID'S (2/5/21)

by AnonPPP