Youtube: UpDown to Scroll

Scroll up/down when using home/end/up/down arrow instead of controlling the volume.

Version vom 23.03.2017. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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            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         4
// @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.id === 'movie_player' || e.target.id === 'player-api' || e.target.className === 'ytp-progress-bar'
    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);