Adblock Scroll Unblocker and Ad Elements Remover for OneJailbreak.com

Enable scrolling on pages that block it due to adblock detection and remove specific ad elements

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Adblock Scroll Unblocker and Ad Elements Remover for OneJailbreak.com
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Enable scrolling on pages that block it due to adblock detection and remove specific ad elements
// @icon         https://www.google.com/s2/favicons?domain=onejailbreak.com
// @author       sharmanhall
// @match        https://onejailbreak.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to enable scrolling by changing body's style
    const enableScrolling = () => {
        document.body.style.overflow = 'auto';
    };

    // Function to remove specified elements from the page
    const removeAdElements = () => {
        // Remove the 'contentInfo' div element
        const contentInfoElement = document.getElementById('statementBox');
        if (contentInfoElement) {
            contentInfoElement.remove();
        }

        // Remove 'anchores' div elements containing ads
        const adElements = document.querySelectorAll('.anchores');
        adElements.forEach(el => el.remove());
    };

    // Wait for the document to be fully loaded
    document.addEventListener('DOMContentLoaded', () => {
        // Call the functions to enable scrolling and remove ad elements
        enableScrolling();
        removeAdElements();
    });

    // Observe for any changes that might re-disable scrolling or re-add ad elements
    const observer = new MutationObserver(mutations => {
        mutations.forEach(mutation => {
            // If body's style is modified, re-enable scrolling
            if (mutation.attributeName === 'style') {
                enableScrolling();
            }
            // Check and remove ad elements if they are added again
            removeAdElements();
        });
    });

    // Configuration for the observer
    const config = { attributes: true, childList: true, subtree: true };

    // Start observing the body element for changes in attributes and child elements
    observer.observe(document.body, config);
})();