您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Scroll up/down when using home/end/up/down arrow instead of controlling the volume.
当前为
- // ==UserScript==
- // @name Youtube: UpDown to Scroll
- // @description Scroll up/down when using home/end/up/down arrow instead of controlling the volume.
- // @author Chris H (Zren)
- // @icon https://youtube.com/favicon.ico
- // @namespace http://xshade.ca
- // @version 3
- // @include http*://*.youtube.com/*
- // @include http*://youtube.com/*
- // @include http*://*.youtu.be/*
- // @include http*://youtu.be/*
- // ==/UserScript==
- window.addEventListener('keydown', function(e) {
- var validTarget = e.target === document.querySelector('#movie_player') || e.target === document.querySelector('#player-api');
- if (validTarget) {
- if (e.keyCode === 35) { // End
- e.stopPropagation()
- } else if (e.keyCode === 36) { // Home
- e.stopPropagation()
- } else if (e.keyCode === 38) { // ArrowUp
- e.stopPropagation()
- } else if (e.keyCode === 40) { // ArrowDown
- e.stopPropagation()
- }
- }
- }, true);