Skip to content

Instantly share code, notes, and snippets.

@saschanaz
Last active January 21, 2020 10:11
Show Gist options
  • Save saschanaz/fa5e0b930a429c413ac704711f4266eb to your computer and use it in GitHub Desktop.
Save saschanaz/fa5e0b930a429c413ac704711f4266eb to your computer and use it in GitHub Desktop.
no-arknights
// ==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