diff --git a/src/config.ts b/src/config.ts index bb4d5854..3ddf05a1 100644 --- a/src/config.ts +++ b/src/config.ts @@ -219,8 +219,8 @@ const Config: SBObject = { skipKeybind: {key: "Enter"}, startSponsorKeybind: {key: ";"}, submitKeybind: {key: "'"}, - nextChapterKeybind: {key: "]", ctrl: true}, - previousChapterKeybind: {key: "[", ctrl: true}, + nextChapterKeybind: {key: "ArrowRight", ctrl: true}, + previousChapterKeybind: {key: "ArrowLeft", ctrl: true}, categorySelections: [{ name: "sponsor" as Category, diff --git a/src/content.ts b/src/content.ts index ee1e638f..4651e720 100644 --- a/src/content.ts +++ b/src/content.ts @@ -2489,6 +2489,12 @@ function addPageListeners(): void { function addHotkeyListener(): void { document.addEventListener("keydown", hotkeyListener); + + document.addEventListener("DOMContentLoaded", () => { + // Allow us to stop propagation to YouTube by being deeper + document.removeEventListener("keydown", hotkeyListener); + document.body.addEventListener("keydown", hotkeyListener); + }); } function hotkeyListener(e: KeyboardEvent): void { @@ -2520,9 +2526,11 @@ function hotkeyListener(e: KeyboardEvent): void { submitSponsorTimes(); return; } else if (keybindEquals(key, nextChapterKey)) { + if (sponsorTimes.length > 0) e.stopPropagation(); nextChapter(); return; } else if (keybindEquals(key, previousChapterKey)) { + if (sponsorTimes.length > 0) e.stopPropagation(); previousChapter(); return; }