NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Auto scrolldown and refresh // @namespace https://openuserjs.org/users/evildog1 // @version 1.0 // @description Useful for kiosk // @license MIT // @author evildog1 // @match https://*/* // @grant none // ==/UserScript== var lastScrollHeight = 0; var bottom; var isSetTimeout; function pageScroll() { var sh = document.documentElement.scrollHeight; if (sh != lastScrollHeight) { lastScrollHeight = sh; document.documentElement.scrollTop = 0; } document.documentElement.scrollHeight = 0; if (!bottom) { window.scrollBy(0, 1); setTimeout(pageScroll, 15); } else { window.scrollBy(0, -1); setTimeout(pageScroll, 15); } if (!isSetTimeout) { setTimeout(refresh, 600000); //10 min 600000 isSetTimeout = true; } } pageScroll(); window.onscroll = function(ev) { if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) { bottom = true; } if (window.scrollY == 0) { bottom = false; } }; function refresh() { window.location.reload(true); }