2022-10-25 19:39:14 +02:00
|
|
|
// ==UserScript==
|
2023-02-21 21:47:46 +01:00
|
|
|
// @name 4c-autohide
|
|
|
|
// @description Keyword based thread hider
|
2023-02-28 20:05:00 +01:00
|
|
|
// @author 17ms
|
|
|
|
// @license MIT License
|
2022-10-25 19:39:14 +02:00
|
|
|
// @namespace Violentmonkey Scripts
|
2023-02-28 20:05:00 +01:00
|
|
|
// @match *://boards.4chan*.org/*/catalog
|
2022-10-25 19:39:14 +02:00
|
|
|
// @version 1.0
|
|
|
|
// ==/UserScript==
|
|
|
|
|
2023-02-16 21:19:01 +01:00
|
|
|
window.addEventListener("load", () => {
|
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) {
|
2023-02-16 21:19:01 +01:00
|
|
|
let innerText = data[i].innerText
|
2022-12-09 02:42:45 +01:00
|
|
|
for (let j = 0; j < keywords.length; ++j) {
|
2023-02-16 21:19:01 +01:00
|
|
|
if (innerText.includes(keywords[j]) && data[i].offsetParent !== null) {
|
2022-12-09 02:42:45 +01:00
|
|
|
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
|
|
|
})
|