Auto scroller

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

Advertisement:

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Advertisement:

// ==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
    }
  }
}