Disable YouTube Number Keyboard Seek Shortcuts

disables the 0-9 keyboard shortcuts

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ć!)

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ć!)

// ==UserScript==
// @name        Disable YouTube Number Keyboard Seek Shortcuts
// @namespace   https://github.com/timmontague/youtube-disable-number-seek
// @description disables the 0-9 keyboard shortcuts
// @author      timm
// @version     1.0.1

// @match       *://www.youtube.com/*

// @match       *://vid.puffyan.us/*
// @match       *://invidious.fdn.fr/*
// @match       *://invidious.048596.xyz/*
// @match       *://invidious.site/*
// @match       *://yewtu.be/*
// @match       *://invidiou.site/*
// @match       *://invidious.himiko.cloud/*
// @match       *://invidious.snopyta.org/*
// @match       *://invidious.namazso.eu/*
// @match       *://invidious.xyz/*
// @match       *://ytprivate.com/*
// @match       *://invidious.kavin.rocks/*
// @match       *://invidious.tinfoil-hat.net/*
// @match       *://tube.connect.cafe/*
// @match       *://invidious.tube/*
// ==/UserScript==

function keyboard_event_handler(e) {
    // Don't prevent entering numbers in input areas
    if (e.target.tagName == 'INPUT' ||
	e.target.tagName == 'SELECT' ||
	e.target.tagName == 'TEXTAREA' ||
	e.target.isContentEditable) {
	return;
    }
    // Trap number keys
    if (e.key >= '0' && e.key <= '9') {
	e.stopImmediatePropagation();
    }
}
window.addEventListener('keydown', keyboard_event_handler, true);