Last active
May 31, 2021 06:20
-
-
Save amin3mej/03859407a2e680ab2dc235be524fbe6f to your computer and use it in GitHub Desktop.
go to end
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
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function run() { | |
let last; | |
for (let i = 0; i < 2;) { | |
await sleep(2000); | |
if(last == document.body.scrollHeight) i++; | |
window.scrollTo(0,document.body.scrollHeight); | |
last = document.body.scrollHeight; | |
} | |
} | |
run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment