Skip to content

Commit

Permalink
Don't transmit keys used for scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrews54757 committed May 26, 2024
1 parent 076d5f2 commit 41d82f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chrome/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,10 @@ if (is_url_yt(window.location.href)) {
'KeyC', // captions
];

const TransmitBlacklist = [
'ArrowUp', 'ArrowDown', // Scroll
];

document.addEventListener('keydown', (e) => {
if (isActiveElementEditable()) {
return;
Expand All @@ -1002,6 +1006,10 @@ if (is_url_yt(window.location.href)) {
return;
}

if (TransmitBlacklist.includes(e.code)) {
return;
}

chrome.runtime.sendMessage({
type: 'transmit_key',
key: getKeyString(e),
Expand Down

0 comments on commit 41d82f0

Please sign in to comment.