// ==UserScript== // @name 爱上ASMR - 视频评论区黑名单 // @namespace https://www.asasmr2.com/ // @version 1.0 // @description 删除黑名单用户的评论 // @match https://www.asasmr2.com/video/*.html // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; function blockLinkParentsGrandparents() { var blockedLinks = [ 'https://www.asasmr2.com/author/392132' ]; for (var i = 0; i < blockedLinks.length; i++) { var links = document.querySelectorAll('a[href="' + blockedLinks[i] + '"]'); for (var j = 0; j < links.length; j++) { var link = links[j]; var grandparent = link.parentElement.parentElement; grandparent.style.display = 'none'; } } } window.addEventListener('load', blockLinkParentsGrandparents); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.addedNodes && mutation.addedNodes.length > 0) { blockLinkParentsGrandparents(); } }); }); observer.observe(document.body, { childList: true, subtree: true }); })();