javascript - 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.
解决方案
推荐阅读
- google-chrome - 谷歌浏览器无法在 Mac 上安装
- i3 - 键绑定到关机电脑
- javascript - Javascript - 为导出的类创建事件侦听器
- cookies - 移动 Safari:iframe 缺少 cookie
- node.js - Discord JS member.ban 不删除消息
- javascript - React:将 event.preventDefault() 方法添加到功能组件中
- jquery - 使用带有自定义回调/jquery 选择器的 sweetalert2
- linux - 在图形输出到达 linux 帧缓冲区之前拦截和转移图形输出,而不是使用 X11
- c# - C# 套接字客户端服务器断开连接
- python - 将 (n_samples, n_features) ndarray 转换为 (n_samples, 1) 向量数组以用作 sklearn SVM 的训练标签