S1 User Blocker

Block certain user's content

Version vom 10.01.2021. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         S1 User Blocker
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Block certain user's content
// @author       冰箱研会长
// @match        https://bbs.saraba1st.com/2b/*
// ==/UserScript==

var User_Blocked = new Array("要屏蔽的用户","用半角逗号分开","还要用双引号括起来");

function S1_Reply_Blocker(NodeRoot){
    var PostLists = NodeRoot.getElementById("postlist");
    if(PostLists){
        var PostTables = PostLists.getElementsByClassName("plhin");
        for (var i=0;i< PostTables.length;i++){
            var PostTable = PostTables[i];
            if(User_Blocked.includes( PostTable.getElementsByClassName("pls favatar")[0].
                                     getElementsByClassName("authi")[0].
                                     getElementsByTagName("a")[0].
                                     innerText)){
                PostTable.parentElement.style.display = "none";
            }
        }
    }
}

function S1_Sure_Blocker(NodeRoot){
    var SureList = NodeRoot.getElementById("threadlisttableid");
    if(SureList){
        var SureAuthors = SureList.getElementsByClassName("by");
        for (var counter = 0;counter < SureAuthors.length;counter=counter + 2){
            var SureAuthor = SureAuthors[counter];
            if(User_Blocked.includes(SureAuthor.
                                     getElementsByTagName("a")[0].
                                     innerText)){
                SureAuthor.parentElement.parentElement.style.display = "none";
            }
        }
    }

}

S1_Reply_Blocker(document);
S1_Sure_Blocker(document);