TEXT   334   0
   253 2.77 KB    88

Flag Hider (4ChanX)

By AnonPPP
Created: 2021-07-16 21:31:33
Updated: 2021-10-01 15:08:14
Expiry: Never

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

/mlp/ Flags All ID'S

by AnonPPP

Flag Hider (4ChanX)

by AnonPPP

Flag Filter (4ChanX)

by AnonPPP

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

by AnonPPP

MLP G5 Stream Compilation

by AnonPPP