Make scroll work at thebalancemoney.com

Make scroll work at thebalancemoney.com while using uBlock and other tools to block tracking, ads and popups

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Make scroll work at thebalancemoney.com
// @namespace   https://github.com/luigiMinardi
// @match       https://www.thebalancemoney.com/*
// @grant       none
// @version     1.1
// @author      luigiMinardi
// @license     MIT
// @description Make scroll work at thebalancemoney.com while using uBlock and other tools to block tracking, ads and popups
// @homepageURL https://greasyfork.org/en/scripts/542456-make-scroll-work-at-thebalancemoney-com
// ==/UserScript==

(function () {
    'use strict';

    // Restore scrolling on body and html
    document.body.style.overflow = 'auto';
    document.documentElement.style.overflow = 'auto';

    // Optional: remove common overlay elements
    const selectors = [
        '[class*="overlay"]',
        '[class*="popup"]',
        '[class*="modal"]',
        '[id*="overlay"]',
        '[id*="popup"]',
        '[id*="modal"]'
    ];

    selectors.forEach(selector => {
        document.querySelectorAll(selector).forEach(el => {
            el.remove();
        });
    });

    // Remove inline scroll lock styles
    const unlockScroll = () => {
        document.body.style.position = 'static';
        document.body.style.height = 'auto';
        document.body.style.overflow = 'auto';

        document.documentElement.style.overflow = 'auto';
        document.documentElement.style.height = 'auto';
    };

    unlockScroll();

    // Also observe for DOM changes (e.g., if scroll lock is reapplied)
    const observer = new MutationObserver(unlockScroll);
    observer.observe(document.body, { attributes: true, childList: true, subtree: true });
})();