From 2cbe1bdb01340cc851d70e34ecf839cd49a20f50 Mon Sep 17 00:00:00 2001 From: ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> Date: Wed, 22 Mar 2023 00:19:27 -0500 Subject: [PATCH] Update osdVisible function --- .../Configuration/inject.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js index ca3d7c0..1154dcb 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js @@ -181,18 +181,12 @@ introSkipper.injectButton = async function () { controls.appendChild(button); } +/** Tests if the OSD controls are visible. */ introSkipper.osdVisible = function () { - let osd = document.querySelector("div.videoOsdBottom"); - - if (!osd) { - return false; - - } - - return !osd.classList.contains("hide"); + const osd = document.querySelector("div.videoOsdBottom"); + return osd ? !osd.classList.contains("hide") : false; } - /** Get the currently playing skippable segment. */ introSkipper.getCurrentSegment = function (position) { for (let key in introSkipper.skipSegments) {