diff --git a/maze-utils b/maze-utils index 33f0b5b7..e2f19e21 160000 --- a/maze-utils +++ b/maze-utils @@ -1 +1 @@ -Subproject commit 33f0b5b7579d77171c07c4b79c8eec45adf802dd +Subproject commit e2f19e21c23342638e26fd642ca9665b5b2ee775 diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index d688d6ca..4acf4964 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -9,7 +9,7 @@ import { ActionType, Category, CategorySkipOption, SegmentContainer, SponsorHide import { partition } from "../utils/arrayUtils"; import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils"; import { normalizeChapterName } from "../utils/exporter"; -import { findValidElement } from "../../maze-utils/src/dom"; +import { findNonEmptyElement, findValidElement } from "../../maze-utils/src/dom"; import { addCleanupListener } from "../../maze-utils/src/cleanup"; import { hasAutogeneratedChapters, isVisible } from "../utils/pageUtils"; import { isVorapisInstalled } from "../utils/compatibility"; @@ -131,8 +131,10 @@ class PreviewBar { // global chapter tooltip or duration tooltip // YT, Vorapis, unknown, YTTV const tooltipTextWrapper = document.querySelector(".ytp-tooltip-text-wrapper, .ytp-progress-tooltip-text-container, .yssi-slider .ys-seek-details .time-info-bar") ?? document.querySelector("#progress-bar-container.ytk-player > #hover-time-info"); - const originalTooltip = (tooltipTextWrapper.querySelector(".ytp-tooltip-progress-bar-pill-title") ?? - tooltipTextWrapper.querySelector(".ytp-tooltip-title:not(.sponsorCategoryTooltip), .ytp-progress-tooltip-text:not(.sponsorCategoryTooltip), .current-time:not(.sponsorCategoryTooltip)")) as HTMLElement; + const originalTooltip = findNonEmptyElement([ + ".ytp-tooltip-title:not(.sponsorCategoryTooltip), .ytp-progress-tooltip-text:not(.sponsorCategoryTooltip), .current-time:not(.sponsorCategoryTooltip)", + ".ytp-tooltip-progress-bar-pill-title" + ]); if (!tooltipTextWrapper || !tooltipTextWrapper.parentElement) return; // Grab the tooltip from the text wrapper as the tooltip doesn't have its classes on init