AutoScroll1234

AutoScroll-自动滚屏

当前为 2021-06-23 提交的版本,查看 最新版本

// ==UserScript==
// @name        AutoScroll1234
// @namespace   
// @description AutoScroll-自动滚屏
// @include     http*
// @version     v1.2
// @author      nosura
// @grant       none
// ==/UserScript==

(() => {
  let scrollY = 0;
  const intervalId = setInterval(() => {
    scrollY = window.scrollY
    window.scroll(0, window.scrollY + 1);
    if (scrollY >= window.scrollY) {
      window.scroll(0, 0)
      clearInterval(intervalId);
      window.location.reload()
    }
  }, 100);

  document.addEventListener('dblclick', () => {
    if (!document.fullscreenElement) {
      document.documentElement.requestFullscreen();
    } else {
      if (document.exitFullscreen) {
        document.exitFullscreen();
      }
    }
  })
})()