Disable YouTube Hotkeys with Modern Settings Page

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

< Opiniones de Disable YouTube Hotkeys with Modern Settings Page

Puntuación: Bueno; el script funciona tal y como promete

§
Publicado: 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;

Publicar respuesta

Inicia sesión para responder.