YouTube Spacebar Controls

Disable spacebar scrolling and enable spacebar controls on YouTube

< Feedback on YouTube Spacebar Controls

Review: OK - script works, but has bugs

§
Posted: 11/05/2023

It doesn't work when pressing Space right after moving to the tab and right after reloading the tab. To fix it, you need to call the controlVideo(e); from the preventSpaceScroll. Though it would be best if you merged the two functions into a single one, which to check both things.


    function preventSpaceScroll(e) {
        if (e.code === 'Space' && e.target === document.body) {
            e.preventDefault();
            controlVideo(e);
        }
    }

Post reply

Sign in to post a reply.