Skip to content

Commit ede5596

Browse files
committed
Don't handle handled events. Fixes #226
1 parent aa7e2ef commit ede5596

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Chromium (.crx)/includes/modern_scroll.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ let last_clicked_element_is_scrollable;
15161516
//let test = 0;
15171517
function arrowkeyscroll(e)
15181518
{
1519-
if(e.which < 37 || e.which > 40 || modifierkey_pressed(e) || target_is_input(e)) return;
1519+
if(e.defaultPrevented || e.which < 37 || e.which > 40 || modifierkey_pressed(e) || target_is_input(e)) return;
15201520

15211521
window.removeEventListener("keydown", arrowkeyscroll, false);
15221522

@@ -1595,17 +1595,17 @@ function arrowkeyscroll(e)
15951595

15961596
function otherkeyscroll(e)
15971597
{
1598-
if(e.which > 34 && e.which < 37 && !modifierkey_pressed(e) && !target_is_input(e))
1598+
if(e.defaultPrevented || target_is_input(e)) return;
1599+
1600+
if(e.which > 34 && e.which < 37 && !modifierkey_pressed(e))
15991601
{
16001602
stopEvent(e);
16011603

16021604
if (e.which === 36) scroll_Pos1();
16031605
else scroll_End();
16041606
}
1605-
else if(e.which === 32 && !e.altKey && !e.metaKey && !e.ctrlKey && !target_is_input(e)) // 32 = space bar
1607+
else if(e.which === 32 && !e.altKey && !e.metaKey && !e.ctrlKey) // 32 = space bar
16061608
{
1607-
if(document.URL.includes("//www.youtube.com/watch")) return; // disable space on YouTube videos because it simultaneously plays / pauses the video (Issue #109)
1608-
16091609
stopEvent(e);
16101610

16111611
if (!e.shiftKey) scroll_PageDown();

0 commit comments

Comments
 (0)