MADBLOX Ad Blocker

MADBLOX Ad Blocker | Don't give money to the stupid people that run madblox!

当前为 2024-07-23 提交的版本,查看 最新版本

// ==UserScript==
// @name         MADBLOX Ad Blocker
// @namespace    http://tampermonkey.net/
// @version      2024-07-24
// @description  MADBLOX Ad Blocker | Don't give money to the stupid people that run madblox!
// @author       watrabi
// @match        https://robloxa.cf/*
// @icon         https://robloxa.cf/images/MADBLOXsmall.png
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const div = document.querySelector('div img[src="/images/madbloxlogo.png"]');
    if (div && div.parentElement) {
        div.parentElement.remove();
    }

    function remove(pattern) {
        const elements = document.querySelectorAll('*');
        elements.forEach(element => {
            const classes = element.className.split(' ');
            classes.forEach(cls => {
                if (pattern.test(cls)) {
                    element.classList.remove(cls);
                }
            });
        });
    }

    const ad = /ad/i;
    const adv = /advertisement/i;
    const advert = /advert/i;
    const card = /card/i;

    remove(ad);
    remove(adv);
    remove(advert);
    remove(card);
})();