Block website from disabling to scroll
目前為
// ==UserScript==
// @name Let Me Scroll
// @namespace http://tampermonkey.net/
// @version 2024-06-19
// @description Block website from disabling to scroll
// @author polyarkk
// @match https://*/*
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// Your code here...
const observer = new MutationObserver((mutationsList, observer) => {
for (const mutation of mutationsList) {
if (mutation.type === "attributes") {
if (mutation.attributeName === "style") {
if (document.body.style.overflow === "hidden") {
console.log("website is attempting to disable scrolling...");
document.body.style.overflow = "auto";
}
}
}
}
});
observer.observe(document.body, { attributes: true, childList: true, subtree: true });
document.body.style.overflow = "auto";
})();