AutoScroll-自动滚屏
当前为
// ==UserScript==
// @name AutoScroll1234
// @namespace
// @description AutoScroll-自动滚屏
// @include http*
// @version v1.5
// @author nosura
// @grant none
// ==/UserScript==
window.onload = () => {
document.documentElement.requestFullscreen();
let enabled = true
let scrollY = 0;
const intervalId = setInterval(() => {
if (enabled) {
scrollY = window.scrollY
window.scroll(0, window.scrollY + 1);
if (scrollY >= window.scrollY) {
window.scroll(0, 0)
clearInterval(intervalId);
window.history.go(-1)
}
}
}, 10);
document.addEventListener('dblclick', () => {
if (!document.fullscreenElement) {
enabled = true
document.documentElement.requestFullscreen();
} else {
if (document.exitFullscreen) {
enabled = false
document.exitFullscreen();
}
}
})
}