commit 5fd435df4aaded68babb383d58852ebe5448e69d parent c9d9e2879ca7ebf8cc033d7b1fbe48c603f61bee Author: Matsuda Kenji <contact2655@matsudakenji.xyz> Date: Thu, 28 Jul 2022 07:23:31 +0900 add twitter.js Diffstat:
A | config/scripts/twitter.js | | | 10 | ++++++++++ |
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/config/scripts/twitter.js b/config/scripts/twitter.js @@ -0,0 +1,10 @@ +function adblock() { + let spans = document.getElementsByTagName('span'); + for (let i = 0; i < spans.length; i++){ + if(spans[i].innerHTML == "Promoted" || spans[i].innerHTML == "プロモーション"){ + spans[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "none"; + } + } +} + +document.addEventListner(load, adblock());