Disable YouTube Hotkeys with Modern Settings Page

Disable various YouTube hotkeys, including frame skip, with a modern settings page

< Opinie na Disable YouTube Hotkeys with Modern Settings Page

Ocena: Dobry - skrypt działa

§
Napisano: 25-04-2025

How about checking whether the selected element is a text input? The original code prohibits typing a blocked key in a search and comment.

    // Function to handle keydown events and disable selected hotkeys
    window.addEventListener('keydown', function(e) {
        const targetElement = e.target;
        const isTextInput = targetElement.type === "text" || targetElement.type === "textarea" || targetElement.type === "input" || targetElement.id === "contenteditable-root";
        if (isTextInput) return;

Odpowiedz

Zaloguj się, by odpowiedzieć.