Anti [ AdBlock Detector ]

Today I saw a window asking me to disable AdBlock ._. If you also have a problem with this, then you can use this script

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           Anti [ AdBlock Detector ]
// @name:ru        Анти [ Обнаружитель AdBlock-а ]
// @namespace      -
// @version        0.3
// @description    Today I saw a window asking me to disable AdBlock ._. If you also have a problem with this, then you can use this script
// @description:ru Сегодня я увидел окно с просьбой отключить AdBlock ._. Если у вас также есть проблема с этим, то вы можете использовать этот скрипт
// @author         Nudo#7346
// @match          *://moomoo.io/*
// @match          *://*.moomoo.io/*
// @match          *://*.io/*
// @icon           https://moomoo.io/img/favicon.png?v=1
// @run-at         document-start
// @grant          none
// ==/UserScript==

(function() {
    const detected = {
        active: false,
        element: null
    }

    const observer = new MutationObserver(function(mutations) {
        for (const mutation of mutations) {
            for (const node of mutation.addedNodes) {
                if (!node.classList) {
                    continue
                }

                let allElements = Object.values(document.querySelectorAll("*"))

                allElements = allElements.filter((element) => element.classList.value.length && element.tagName === "DIV")

                for (const element of allElements) {
                    if (!element.textContent.match(/Support\sFree\s\w+/)) {
                        continue
                    }

                    detected.active = true
                    detected.element = element

                    observer.disconnect()

                    break
                }
            }
        }
    })

    const interval = setInterval(() => {
        if (!detected.active) return void 0

        if (detected.element.style.visibility === "hidden") return void 0

        detected.element.remove()

        console.log("Anti [ AdBlock Detector ]::success", detected.element)

        clearInterval(interval)
    })

    observer.observe(document, {childList: true, subtree: true})

    setTimeout(() => {
        observer.disconnect()
    }, 30000)
})()