S1 User Blocker

Block certain user's content

Ajankohdalta 10.1.2021. Katso uusin versio.

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

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.

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

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

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);