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