Skip to content

Instantly share code, notes, and snippets.

@dmlogv
Created October 28, 2020 16:28
Show Gist options
  • Save dmlogv/b992073358a0d70fd791871ac79c1e02 to your computer and use it in GitHub Desktop.
Save dmlogv/b992073358a0d70fd791871ac79c1e02 to your computer and use it in GitHub Desktop.
Scroll a web page to the footer (to load endless comments)
/*
* Paste in the developer's console
*/
var i = 0;
function scroll(){
var scrollingElement = (document.scrollingElement || document.body);
scrollingElement.scrollTop = scrollingElement.scrollHeight;
console.log('Scroll', i++);
}
var interval = setInterval(scroll, 500);
document.addEventListener('click', function(){
clearInterval(interval);
console.log('Stopped');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment