Skip to content

Instantly share code, notes, and snippets.

@matthewoestreich
Last active July 12, 2020 21:34
Show Gist options
  • Save matthewoestreich/0221d8639c6363040a64c40a26320ea3 to your computer and use it in GitHub Desktop.
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
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