Created
October 28, 2020 16:28
-
-
Save dmlogv/b992073358a0d70fd791871ac79c1e02 to your computer and use it in GitHub Desktop.
Scroll a web page to the footer (to load endless comments)
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
/* | |
* 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