Hide Employed

Hides users that are part of a company.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Hide Employed
// @namespace    LordBusiness.HE
// @version      1.1
// @description  Hides users that are part of a company.
// @author       LordBusiness [2052465]
// @match        https://www.torn.com/userlist.php*
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const userListWrap = document.querySelector('.user-info-list-wrap');

    new MutationObserver(mutationList => {
        for(const mutationRecord of mutationList) {
            for(const addedNode of mutationRecord.addedNodes) {
                if(addedNode.tagName === 'LI' && !addedNode.className) {

                    /* You can hide any icon you want
                         #icon1 : Online
                         #icon2 : Offline
                         #icon3 : Donator
                         #icon4 : Subscriber
                         #icon8 : Married
                         #icon9 : In a Faction
                         #icon27: Employed in company
                         #icon62: Idle
                         #icon71: Traveling
                         #icon73: Company director
                         #icon74: Faction Leader or Co-leader
                       Use commas(,) to hide multiple         */

                    if(addedNode.querySelector("#icon27, #icon73")) addedNode.style.display = 'none';

                }
            }
        }
    }).observe(userListWrap, { childList: true });
})();