Last active
October 9, 2023 13:35
-
-
Save Utopiah/d0094c8f90efdb7320bb41c3e01ce62a to your computer and use it in GitHub Desktop.
Firefox PDF.js reader autoscroll shorcuts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use the s shortcut to toggle autoscroll | |
var as; document.onkeyup = function(e) { | |
if(e.key == "s"){ | |
if (!as) { | |
as = setInterval( () => { document.querySelector("#viewerContainer").scrollBy(0, 1) } , 100 ); | |
// for a normal page use window.scrollBy instead | |
} else { | |
clearInterval(as); as = null; scrolling = false; | |
} | |
} | |
} | |
// example GIF https://twitter.com/utopiah/status/1101890549504724993 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment