Disable YouTube Hotkeys with Modern Settings Page

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

< Feedback on Disable YouTube Hotkeys with Modern Settings Page

Review: Good - script works

§
Posted: 25.4.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;

Post reply

Sign in to post a reply.