userscripts/visual/4chan-hide-threads.js

22 lines
673 B
JavaScript
Raw Normal View History

2022-10-25 19:39:14 +02:00
// ==UserScript==
// @name Hide threads with certain keywords from catalog - 4chan.org
2022-10-25 19:39:14 +02:00
// @namespace Violentmonkey Scripts
// @match *://boards.4channel.org/*/catalog
// @match *://boards.4chan.org/*/catalog
2022-10-25 19:39:14 +02:00
// @version 1.0
// ==/UserScript==
window.addEventListener("load", function () {
2022-12-09 02:42:45 +01:00
const keywords = [] // e.g. ["/sdg/", "luke smith"]
const data = document.getElementsByClassName("teaser")
2022-10-25 19:39:14 +02:00
2022-12-09 02:42:45 +01:00
for (let i = 0; i < data.length; ++i) {
let inner_txt = data[i].innerText
for (let j = 0; j < keywords.length; ++j) {
if (inner_txt.includes(keywords[j])) {
data[i].offsetParent.style.display = "none"
}
2022-10-25 19:39:14 +02:00
}
2022-12-09 02:42:45 +01:00
}
2022-10-25 19:39:14 +02:00
})