Last active
July 12, 2020 21:34
-
-
Save matthewoestreich/0221d8639c6363040a64c40a26320ea3 to your computer and use it in GitHub Desktop.
Get past paywall - for sites that disable scroll - use this to scroll up/down with a/z keys respectively
This file contains hidden or 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
function KeyPress(e) { | |
const { keyCode } = window.event ? event : e; | |
// If "a" is pressed, scroll up | |
if (keyCode == 65) { | |
window.scrollBy(0, -100) | |
} | |
// If "z" is pressed, scroll down | |
if (keyCode == 90) { | |
window.scrollBy(0, 100) | |
} | |
} | |
document.onkeydown = KeyPress; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment