Tcafe Block User

try to take over the world!

Från och med 2020-12-12. Se den senaste versionen.

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 or Violentmonkey 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         Tcafe Block User
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the world!
// @author       You
// @include      /tcafe2a.com/
// @require      http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

// 차단유저 ID
const IDs = ['testid1', 'testid2', 'testid3']
//const IDs = JSON.parse(GM_getValue("IDs"))

// 대상 node 선택
var target = document.querySelector('body')


// 감시자 인스턴스 만들기
var observer = new MutationObserver(function(mutations) {

    IDs.forEach(function (ID, index, array) {        
        let IDNode = document.querySelectorAll("a[onclick*=" + ID +"]")

        if(IDNode){
            if(/wr_id/.test(window.location.href)){
                for(var i=0; i < IDNode.length; i++) {
                    if (IDNode[i].parentNode) {
                        $(IDNode[i]).closest('div.box').remove()
                        console.log(IDNode[i])
                    }
                }
            }
            for(var j=0; j < IDNode.length; j++) {
                if (IDNode[j].parentNode) {
                    $(IDNode[j]).closest('tr').remove()
                    console.log(IDNode[j])
                }
            }

        }
    })


})

// 감시자의 설정:
var config = { attributes: true, childList: true };

// 감시자 옵션 포함, 대상 노드에 전달
observer.observe(target, config);

// 차단 ID 저장
//GM_setValue("IDs", JSON.stringify(IDs))