YouTube Spacebar Controls

Disable spacebar scrolling and enable spacebar controls on YouTube

< Valutazione su YouTube Spacebar Controls

Recensione: OK - lo script funziona, ma ha degli errori.

§
Pubblicato: 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);
        }
    }

Pubblica risposta

Accedi per pubblicare una risposta.