NoSerg121

Скрывает активность Serg121

当前为 2021-07-18 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         NoSerg121
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Скрывает активность Serg121
// @author       S30N1K
// @match        https://dota2.ru/*
// @grant        none
// ==/UserScript==

(() => {
    const banned = ["Serg121"]

    const index = () => {
        const themes = $(".index__left-bar > .forum.component-block.component-block__hide-after-12 > ul > li")
        for (const theme of themes){
            const $theme = $(theme)
            const userNick = $theme.find(".component-text-grey-11").html().split("<")[0].trim()
            if (banned.includes(userNick)){
                $theme.remove()
            }
        }
    }

    const members = () => {

    }

    const notifications = () => {

    }

    const forums = () => {
        const themes = $(".forum-section__list > li:not(.forum-section__item--first)")
        for (const theme of themes) {
            const $theme = $(theme)
            const userNick = $theme.find(".forum-section__name > a").html().trim()
            if (banned.includes(userNick)){
                $theme.remove()
            }
        }
    }

    const threads = () => {
        const messages = $(".forum-theme__list > li")
        for (const message of messages) {
            const $message = $(message)
            const userNick = $message.find(".forum-theme__item-left-mob > a").html().trim()
            if (banned.includes(userNick)){
                $message.remove()
            }
        }
    }


    const pages = {
        "^\/$": index,
        "\/forum\/members\/(.+?)\/": members,
        "\/forum\/notifications\/": notifications,
        "\/forum\/threads\/": threads,
        "\/forum\/forums\/(.+?)\/": forums,
    }

    for (const e of Object.keys(pages)) {
        if (new RegExp(e).test(window.location.pathname)) {
            pages[e]()
        }
    }
})()