您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
use alt= to scroll down, alt- to scroll up(both can be faster by pressing more), and alt+0 to stop.
- // ==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
- }
- }
- }