Last active
January 21, 2020 10:11
-
-
Save saschanaz/fa5e0b930a429c413ac704711f4266eb to your computer and use it in GitHub Desktop.
no-arknights
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
// ==UserScript== | |
// @name No Arknights on ANIPLUSTV | |
// @namespace https://saschanaz.github.io/ | |
// @version 0.2 | |
// @description No Arknights on ANIPLUSTV | |
// @author You | |
// @match http://www.aniplustv.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function remove(parent) { | |
parent.querySelectorAll("a[href*=arknights]").forEach(anchor => { | |
anchor.remove(); | |
}); | |
} | |
remove(document); | |
const observer = new MutationObserver(mutationsList => { | |
for (const mutation of mutationsList) { | |
if (mutation.type === "childList") { | |
for (const node of mutation.addedNodes) { | |
if (node.nodeType === Node.ELEMENT_NODE) { | |
remove(node); | |
} | |
} | |
} | |
} | |
}); | |
observer.observe(document.body, { childList: true, subtree: true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment