Created
November 5, 2020 13:27
-
-
Save ltpitt/185e162f18263c2270fb1dd220f0f8a3 to your computer and use it in GitHub Desktop.
Just a simple Javascript webpage scroller I needed to read content hidden behind a paywall
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
// Open your browser's console, paste this script in it and press enter. | |
// Reload the page using F5 to cancel the script's effects. | |
async function autoScroll(scrollStartHeight, scrollSpeed, waitTimeBetweenScrolls){ | |
let currentScrollHeight = scrollStartHeight; | |
while (currentScrollHeight < document.body.scrollHeight) { | |
currentScrollHeight += scrollSpeed; | |
await new Promise(r => setTimeout(r, waitTimeBetweenScrolls)); | |
window.scrollTo(scrollStartHeight, currentScrollHeight); | |
} | |
} | |
autoScroll(0, 1, 50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment