block2078

Block screen and scrollbar till clicked

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.greasyfork.org/scripts/491233/1351458/block2078.js

document.documentElement.addEventListener('click', function () {
    const currentState = document.body.style.overflowY;

    if (currentState === 'hidden' || currentState === '') {
        document.documentElement.style.overflowY = 'auto';
    } else {
        document.documentElement.style.overflowY = 'auto';
    }
});