S1 User Blocker

Block certain user's content

Verze ze dne 10. 01. 2021. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

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