Skip to content

Commit 948e39e

Browse files
committed
Actual fix for original tooltip not being found
1 parent f6360a4 commit 948e39e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js-components/previewBar.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ class PreviewBar {
132132
// global chapter tooltip or duration tooltip
133133
// YT, Vorapis, unknown, YTTV
134134
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");
135+
const defaultTooltipSelector = ".ytp-tooltip-title:not(.sponsorCategoryTooltip), .ytp-tooltip-title:not(.sponsorCategoryTooltip) span, .ytp-progress-tooltip-text:not(.sponsorCategoryTooltip), .current-time:not(.sponsorCategoryTooltip)";
135136
const originalTooltip = findNonEmptyElement([
136-
".ytp-tooltip-title:not(.sponsorCategoryTooltip), .ytp-tooltip-title:not(.sponsorCategoryTooltip) span, .ytp-progress-tooltip-text:not(.sponsorCategoryTooltip), .current-time:not(.sponsorCategoryTooltip)",
137+
defaultTooltipSelector,
137138
".ytp-tooltip-progress-bar-pill-title"
138-
]);
139+
]) ?? document.querySelector(defaultTooltipSelector);
139140
if (!tooltipTextWrapper || !tooltipTextWrapper.parentElement) return;
140141

141142
// Grab the tooltip from the text wrapper as the tooltip doesn't have its classes on init

0 commit comments

Comments
 (0)