Files
tool__scripts/browser-snippets/auto-scroller.js
2026-07-09 01:05:56 +02:00

29 lines
701 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const scrollSpeed = 3;
const scrollDelay = 20;
let autoScrollInterval = null;
function startAutoScroll(){
if(autoScrollInterval) return;
autoScrollInterval = setInterval(() => {
window.scrollBy(0, scrollSpeed);
if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) {
/** Uncomment if you want to enable auto-stop on page end */
//stopAutoScroll();
//console.log("🙄 Reached bottom of page.");
}
}, scrollDelay);
console.log("💠‍🌐 Auto‑scroll engaged.");
}
function stopAutoScroll(){
clearInterval(autoScrollInterval);
autoScrollInterval = null;
console.log("💠‍🌐 Auto‑scroll disengaged.");
}
startAutoScroll();