Remove tp-modal-open on Technology Review

Removes the tp-modal-open class from <body> on load and DOM changes

Ekde 2025/04/04. Vidu La ĝisdata versio.

// ==UserScript==
// @name         Remove tp-modal-open on Technology Review
// @description  Removes the tp-modal-open class from <body> on load and DOM changes
// @match        https://www.technologyreview.com/*
// @version 0.0.1.20250404080001
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==

(function() {
    'use strict';

    const removeModalClass = () => {
        document.body.classList.remove('tp-modal-open');
    };

    // Run on initial load
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', removeModalClass);
    } else {
        removeModalClass();
    }

    // Watch for changes to the body class
    const observer = new MutationObserver(removeModalClass);
    observer.observe(document.body, {
        attributes: true,
        attributeFilter: ['class']
    });
})();