Last active
September 20, 2023 02:32
-
-
Save chapmanjacobd/aef3649fc23e468dd9f338470e3d194f to your computer and use it in GitHub Desktop.
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
javascript:(function(){ | |
var previousScroll; | |
var scrollInterval; | |
var nextPageTimeout; | |
function scrollAndCheck() { | |
previousScroll = window.scrollY; | |
window.scrollBy(0, 3000); | |
var currentScroll = window.scrollY; | |
var maxScroll = document.body.scrollHeight - window.innerHeight; | |
clearTimeout(nextPageTimeout); | |
nextPageTimeout = setTimeout(function () { | |
if (currentScroll + 10 >= maxScroll && previousScroll == currentScroll) { | |
clearInterval(scrollInterval); | |
} | |
}, 10000); | |
} | |
scrollInterval = setInterval(scrollAndCheck, 1200); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment