Auto scroller

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

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