Auto scroller

use alt= to scroll down, alt- to scroll up(both can be faster by pressing more), and alt+0 to stop.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Auto scroller
// @namespace    https://greasyfork.org/zh-TW/users/11333-bendwarn
// @version      0.1
// @description  use alt= to scroll down, alt- to scroll up(both can be faster by pressing more), and alt+0 to stop.
// @author       bendwarn
// @match        *://*/*
// @run-at       document-idle
// @license      MIT License
// ==/UserScript==
let intervalid = null
let time = 16
let speed = 0
let move = _ => {document.body.scrollTop += speed}
document.body.onkeydown = e => {
  if (e.altKey) {
    let key = e.key
    if (key == '+' || key == '=' || key == '-') {
      speed += (key == '-') ? -2 : 2
      if (intervalid === null) intervalid = setInterval(move, time)
      else {
        clearInterval(intervalid)
        if (speed) intervalid = setInterval(move, time)
        else intervalid = null
      }
    } else if (key == '0') {
      clearInterval(intervalid)
      intervalid = null
      speed = 0
    }
  }
}