Ad blocker

block ads :D

目前為 2021-06-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Ad blocker
// @namespace    -
// @version      1.2
// @description  block ads :D
// @author       Stew
// @match        *://sandbox.moomoo.io/*
// @match        *://moomoo.io/*
// @match        *://sploop.io/*
// @match        *://discord.com/*
// @match        *://aternos.de/*
// @match        *://aternos.org/*
// @icon         https://img.icons8.com/ios/452/ad-blocker.png
// @grant        none
// ==/UserScript==
 
const elements = {
    MooMoo: [null, "onetrust-consent-sdk","moomooio_728x90_home", "promoImgHolder", "adCard", "pre-content-container", "consentBlock"],
    sploop: [null, "lostworld-io_300x250_1", "lostworld-io_300x250_2", "side-nav-left"],
    discord: [null, "notice-3bPHh- colorDefault-22HBa0"]
}
 
 
const website = window.location.host
if(website.includes("moomoo.io")) {
    let webelements = elements.MooMoo;
    let $ = (element) => { return document.getElementById(element) }
    console.log("Ad blocker active!")
    setInterval(() => {
        for(let i = 0; i < webelements.length; i++) {
            if($(`${webelements[i]}`)) {
                if($(`${webelements[i]}`) == $(`${webelements[2]}`)) {
                    console.log("removed special ad (" + i + ")")
                    $(`${webelements[i]}`).parentElement.remove();
                }
                $(`${webelements[i]}`).remove();
                console.log(webelements[2])
                console.log("removed ad (" + i + ")")
            }
        }
    }, 100)
}
if(website.includes("sploop.io")) {
    let webelements = elements.sploop;
    let $ = (element) => { return document.getElementById(element) }
    let specials = ["lostworld-io_300x250_1", "lostworld-io_300x250_2"]
    console.log("Ad blocker active!")
    setInterval(() => {
        for(let i = 0; i < webelements.length; i++) {
            if($(`${webelements[i]}`)) {
                if(specials.includes(webelements[i])) {
                    $(`${webelements[i]}`).parentElement.remove();
                    console.log("removed special ad (" + i + ")")
                } else {
                    $(`${webelements[i]}`).remove();
                    console.log("removed ad (" + i + ")")
                }
 
            }
        }
    }, 100)
}
if(website.includes("discord.com")) {
    let webelements = elements.sploop;
    let $ = (element) => { return document.getElementById(element) }
    let _ = (element) => { return document.getElementsByClassName(element) }
    let classes = ["notice-3bPHh- colorDefault-22HBa0"]
    console.log("Ad blocker active!")
    setInterval(() => {
        for(let i = 0; i < webelements.length; i++) {
            if(classes.includes(webelements[i])) {
                console.log("removed special ad (" + i + ")")
               _(webelements[i])[0].remove()
               }
        }
    }, 100)
}
document.getElementsByClassName("sidebar")[0].remove()
if(website.includes("aternos")) {
    setInterval(() => {
        if(document.getElementById("placement-top-leaderboard")) {
            document.getElementById("placement-top-leaderboard").parentElement.remove()
        }
        if(document.getElementsByClassName("vm-footer")) {
            if(document.getElementsByClassName("vm-footer")[0]) {
                document.getElementsByClassName("vm-footer")[0].remove()
            }
        }
        if(document.getElementsByClassName("sidebar")) {
            if(document.getElementsByClassName("sidebar")[0]) {
                document.getElementsByClassName("sidebar")[0].remove();
            }
        }
        if(document.getElementById("placement-bottom-leaderboard")) {
            document.getElementById("placement-bottom-leaderboard").parentElement.remove()
        }
        if(document.getElementById("placement-options-leaderboard")) {
            document.getElementById("placement-options-leaderboard").parentElement.remove();
        }
        if(document.getElementsByClassName("header-ad")) {
            if(document.getElementsByClassName("header-ad")[0]) {
                document.getElementsByClassName("header-ad")[0].remove()
            }
        }
        if(document.getElementsByClassName("btn btn-white yLqZjoAWcmSNWGWMatEJIeLhuboJjgW")) {
            if(document.getElementsByClassName("btn btn-white yLqZjoAWcmSNWGWMatEJIeLhuboJjgW")[0]) {
                document.getElementsByClassName("btn btn-white yLqZjoAWcmSNWGWMatEJIeLhuboJjgW")[0].click()
            }
        }
    })
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址