Last active
April 24, 2019 05:09
-
-
Save komkanit/8784ead4d5fa2088cab351f18926db3d to your computer and use it in GitHub Desktop.
REMOVE AVENGER SPOILER. copy this code and paste in console on your browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var banList = ['avenger', 'infinity']; | |
setInterval(function() { | |
var a = document.querySelectorAll('[role="article"]') | |
a.forEach((d) => { | |
banList.map((text) => { | |
if (d.innerText.toLocaleLowerCase().indexOf(text) >= 0) { | |
console.log('removed'); | |
d.remove() | |
} | |
}) | |
}) | |
}, 2000) |
Refractor using Regexp kub
const banList = ['avenger', 'infinity'];
const rule = new RegExp(banList.join('|'),'i')
setInterval(function() {
Array.from(document.querySelectorAll('[role="article"]'))
.filter(d => rule.test(d.innerText))
.forEach(d => d.remove())
}, 2000)
@Ranatchai Look much better! thank you kub.
const banList = ['avenger', 'infinity', 'endgame'];
const rule = new RegExp(banList.join('|'),'i')
setInterval(function() {
Array.from(document.querySelectorAll('[role="article"]'))
.filter(d => rule.test(d.innerText))
.forEach(d => d.remove())
}, 2000)
Add endgame krub
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en to run userscript