Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion maze-utils
Submodule maze-utils updated 1 files
+15 −0 src/dom.ts
22 changes: 20 additions & 2 deletions src/js-components/previewBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -131,7 +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-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
Expand Down Expand Up @@ -258,6 +261,21 @@ class PreviewBar {
}

tooltip.style.removeProperty("display");

// For July 2025 test layout
if (document.querySelector(".ytp-delhi-modern")) {
tooltip.style.display = "inline-block";

// Class gets added back, so grab the top value for when the class is removed
tooltip.style.removeProperty("top");
tooltip.classList.remove("ytp-tooltip-text-no-title");

if (tooltip === this.chapterTooltip) {
tooltip.style.top = `calc(${window.getComputedStyle(tooltip).getPropertyValue("top")} + 5px)`;
} else {
tooltip.style.top = window.getComputedStyle(tooltip).getPropertyValue("top");
}
}
} else {
tooltip.style.display = "none";
}
Expand Down