Greasy Fork

来自缓存

U2个人页面关闭坏人卡显示

关闭个人页面坏人卡显示,我没看见等于没有

// ==UserScript==
// @name         U2个人页面关闭坏人卡显示
// @namespace    https://github.com/sion-x
// @version      0.1.1
// @description  关闭个人页面坏人卡显示,我没看见等于没有
// @author       Sion
// @match        https://u2.dmhy.org/userdetails.php?id=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    
function getInnerText(element) {
       if (typeof element.textContent == "undefined") {
           return element.innerText;
       } else {
           return element.textContent;
       }
   }
   
    var hideBlockedBy = function()
    {
        var table = document.getElementsByTagName('td');
        for(var i = 0; i < table.length; i ++)
        {
            if(getInnerText(table[i]) == '收到坏人卡')
            {
                console.log(table[i].parentNode)
                table[i].parentNode.remove()
                return 0;
            }
        }
    }

hideBlockedBy()

})();