Blocks the page by adding a semitransparent white overlay on top of it.
此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.org/scripts/468732/1205573/blockPage.js
// ==UserScript== // @name blockPage // @namespace http://tampermonkey.net/ // @version 0.1 // @description Blocks the page by adding a semitransparent white overlay on top of it. // @author IgnaV // @grant none // ==/UserScript== const blockPage = () => { const overlay = document.createElement("div"); overlay.id = "page-overlay"; overlay.style.cssText = "position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.5);"; document.body.appendChild(overlay); }; const unblockPage = () => { const overlay = document.querySelector("#page-overlay"); if (overlay) { overlay.parentNode.removeChild(overlay); } };