// ==UserScript== // @name stcn屏蔽特定用户 // @namespace acngamer.com // @version 0.2 // @description 本脚本用于屏蔽stcn指定用户的主题以及回复 // @author DL9412 // @match https://steamcn.com/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; //重写ajax添加监听 function ajaxEventTrigger(event) { var ajaxEvent = new CustomEvent(event, { detail: this }); window.dispatchEvent(ajaxEvent); } var oldXHR = window.XMLHttpRequest; function newXHR() { var realXHR = new oldXHR(); realXHR.addEventListener('abort', function () { ajaxEventTrigger.call(this, 'ajaxAbort'); }, false); realXHR.addEventListener('error', function () { ajaxEventTrigger.call(this, 'ajaxError'); }, false); realXHR.addEventListener('load', function () { ajaxEventTrigger.call(this, 'ajaxLoad'); }, false); realXHR.addEventListener('loadstart', function () { ajaxEventTrigger.call(this, 'ajaxLoadStart'); }, false); realXHR.addEventListener('progress', function () { ajaxEventTrigger.call(this, 'ajaxProgress'); }, false); realXHR.addEventListener('timeout', function () { ajaxEventTrigger.call(this, 'ajaxTimeout'); }, false); realXHR.addEventListener('loadend', function () { ajaxEventTrigger.call(this, 'ajaxLoadEnd'); }, false); realXHR.addEventListener('readystatechange', function() { ajaxEventTrigger.call(this, 'ajaxReadyStateChange'); }, false); return realXHR; } window.XMLHttpRequest = newXHR; window.addEventListener('ajaxReadyStateChange', function (e) { if(e.detail.readyState == 4){ setTimeout(function(){hideuser();},1000) } }); window.addEventListener('ajaxAbort', function (e) { }); //此处填写stcn用户uid,单人格式为[xxxxx],多人格式为[xxxxxx,xxxxxx] var uid=[]; var hidetitle=1; var hidereply=1; hideuser(); function hideuser(){ console.info('hidestart'); var type=0; var bd = document.getElementById('nv_forum'); if(bd.className == 'pg_forumdisplay'){ type = 0; }else if(bd.className == 'pg_viewthread'){ type = 1; }else if(bd.className == 'pg_index'){ type = 2; } if(type == 0 && hidetitle == 1){ for(var i=0;i0){ if(reg2.test(ema[0].href)){ replylist2[z].parentNode.style.display = 'none'; } } } } } } })();