Skip to content

Commit 41d82f0

Browse files
committed
Don't transmit keys used for scrolling
1 parent 076d5f2 commit 41d82f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

chrome/content.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,10 @@ if (is_url_yt(window.location.href)) {
993993
'KeyC', // captions
994994
];
995995

996+
const TransmitBlacklist = [
997+
'ArrowUp', 'ArrowDown', // Scroll
998+
];
999+
9961000
document.addEventListener('keydown', (e) => {
9971001
if (isActiveElementEditable()) {
9981002
return;
@@ -1002,6 +1006,10 @@ if (is_url_yt(window.location.href)) {
10021006
return;
10031007
}
10041008

1009+
if (TransmitBlacklist.includes(e.code)) {
1010+
return;
1011+
}
1012+
10051013
chrome.runtime.sendMessage({
10061014
type: 'transmit_key',
10071015
key: getKeyString(e),

0 commit comments

Comments
 (0)