Greasy Fork

Greasy Fork is available in English.

Reset CSS on Economist

Reset overflow and position properties of .sp-message-open body on Economist.com

目前为 2025-03-21 提交的版本,查看 最新版本

// ==UserScript==
// @name         Reset CSS on Economist
// @description  Reset overflow and position properties of .sp-message-open body on Economist.com
// @match        *://*.economist.com/*
// @version 0.0.1.20250321195232
// @namespace http://greasyfork.icu/users/1435046
// ==/UserScript==

(function() {
    'use strict';

    function resetStyles() {
        const body = document.querySelector(".sp-message-open body");
        if (body) {
            body.style.overflow = "";
            body.style.position = "";
        }
    }

    // Run on page load
    resetStyles();

    // Observe for mutations
    const observer = new MutationObserver(resetStyles);
    observer.observe(document.body, { childList: true, subtree: true });
})();