Disp BBS AD blocking dectection blocker

Remove Disp BBS AD blocking dectection dialog

目前為 2023-09-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Disp BBS AD blocking dectection blocker
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Remove Disp BBS AD blocking dectection dialog
// @author       regchiu
// @match        https://disp.cc/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==
let isRemovedDialog = false;
document.addEventListener("readystatechange", () => {
    // Select the node that will be observed for mutations
    const targetNode = document.getElementById("body");

    // Options for the observer (which mutations to observe)
    const config = { attributes: true, childList: true, subtree: true };

    // Callback function to execute when mutations are observed
    const callback = () => {
        const element = document.querySelector(".fc-ab-root");
        if (element) {
            element.remove();
            isRemovedDialog = true;
        }
    };

    // Create an observer instance linked to the callback function
    const observer = new MutationObserver(callback);

    // Start observing the target node for configured mutations
    observer.observe(targetNode, config);
    if (isRemovedDialog) {
        observer.disconnect();
    }
});

QingJ © 2025

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