Skip to content

Instantly share code, notes, and snippets.

@amin3mej
Last active May 31, 2021 06:20
Show Gist options
  • Save amin3mej/03859407a2e680ab2dc235be524fbe6f to your computer and use it in GitHub Desktop.
Save amin3mej/03859407a2e680ab2dc235be524fbe6f to your computer and use it in GitHub Desktop.
go to end
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