SMTH_BLACKLIST

blacklist based on oooOOOooo's code

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         SMTH_BLACKLIST
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  blacklist based on oooOOOooo's code
// @author       You
// @match        https://www.mysmth.net/nForum/
// @grant        none
// ==/UserScript==

(function() {

    var code = `
//黑名单,英文逗号分隔
//修改完记得刷新页面,重新加载这个js
var blacklist = "coollpe,xiaoju,baoai";

bArray = blacklist.split(',');

$("body").on('DOMSubtreeModified', "#body", function() {
//隐藏主题
document.querySelectorAll('a.c63f').forEach(a=>{
bArray.forEach(b=>{
if(a.innerText==b){
a.parentNode.parentNode.style.display = 'none';
}
});
});
//隐藏回复
document.querySelectorAll('span.a-u-name').forEach(n=>{
bArray.forEach(b=>{
if(n.childNodes[0].innerText==b){
n.parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none"
}
});
});
});
`;

    var script = document.createElement('script');
    script.textContent = code;
    (document.head||document.documentElement).appendChild(script);
    script.remove();

})();