From 709da823c0b93ac90c6f1cd30e5ca596eaa74a35 Mon Sep 17 00:00:00 2001 From: 17ms <79069176+17ms@users.noreply.github.com> Date: Mon, 12 Dec 2022 07:36:02 +0200 Subject: [PATCH] fixed bug throwing TypeError with overlapping keywords --- visual/4chan-hide-threads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visual/4chan-hide-threads.js b/visual/4chan-hide-threads.js index 3c454d2..13ae761 100644 --- a/visual/4chan-hide-threads.js +++ b/visual/4chan-hide-threads.js @@ -13,7 +13,7 @@ window.addEventListener("load", function () { 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])) { + if (inner_txt.includes(keywords[j]) && data[i].offsetParent !== null) { data[i].offsetParent.style.display = "none" } }