首页 > 解决方案 > Quill Chrome Extension Youtube hotkeys

问题描述

Background

I am trying to create a chrome extension which displays a quill editor on youtube for note making.I am injecting the quill editor using content script that is visible when a button is clicked on the youtube page.

Problem

Youtube has a lot of hotkeys configured(like f for full screen etc.).When I type in the editor,the hotkeys get executed thus disrupting the flow.

Attempts

One of the things that I tried was to capture onKeydown event but as javascripts of both extension and webpage run in separate environments , it did not work.

document.onkeydown = function (e) {
        return false;
}

Another interesting as youtube hotkeys are disabled when the input field is textarea.So instead of quill,if I use regular text area,it works out fine.But Quill works on divs and not on input/textarea fields.

Is there a way I can disable youtube hotkeys when the quill editor is showing up on screen.

标签: javascriptjqueryyoutubequill

解决方案


推荐阅读