diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js index 4c655b8..c2a7a89 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js @@ -178,19 +178,13 @@ const introSkipper = { overrideBlur(button) { if (!button.originalBlur) { button.originalBlur = button.blur; - button.blur = () => { - if (!button.contains(document.activeElement)) { - button.originalBlur(); + button.blur = function() { + if (!this.contains(document.activeElement)) { + this.originalBlur(); } }; } }, - restoreBlur(button) { - if (button.originalBlur) { - button.blur = button.originalBlur; - delete button.originalBlur; - } - }, /** Playback position changed, check if the skip button needs to be displayed. */ videoPositionChanged() { if (!this.skipButton) return; @@ -201,9 +195,12 @@ const introSkipper = { this.skipButton.classList.remove('show'); embyButton.addEventListener("transitionend", () => { this.skipButton.classList.add("hide"); - this.restoreBlur(embyButton); - embyButton.blur(); this.allowEnter = true; + if (this.osdVisible()) { + this.osdElement.querySelector('button.btnPause').focus(); + } else { + embyButton.originalBlur(); + } }, { once: true }); return; }