Compare commits

...

6 Commits
5.13.4 ... 5.14

Author SHA1 Message Date
Ajay
0bca508004 bump version 2025-07-25 02:15:15 -04:00
Ajay
42ff5f0092 update translations 2025-07-25 02:15:01 -04:00
Ajay
8c2258a331 Add notice about hook category change 2025-07-25 02:13:47 -04:00
Ajay
44177b9ddf Fix hover previews on normal layout 2025-07-24 21:58:38 -04:00
Ajay
33c939281c Show the category name on hover on new YouTube player layout 2025-07-24 21:44:33 -04:00
Ajay
f4d2558856 Add seperate hook category 2025-07-24 14:40:15 -04:00
8 changed files with 71 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
"serverAddress": "https://sponsor.ajay.app",
"testingServerAddress": "https://sponsor.ajay.app/test",
"serverAddressComment": "This specifies the default SponsorBlock server to connect to",
"categoryList": ["sponsor", "selfpromo", "exclusive_access", "interaction", "poi_highlight", "intro", "outro", "preview", "filler", "chapter", "music_offtopic"],
"categoryList": ["sponsor", "selfpromo", "exclusive_access", "interaction", "poi_highlight", "intro", "outro", "preview", "hook", "filler", "chapter", "music_offtopic"],
"categorySupport": {
"sponsor": ["skip", "mute", "full"],
"selfpromo": ["skip", "mute", "full"],
@@ -11,6 +11,7 @@
"intro": ["skip", "mute"],
"outro": ["skip", "mute"],
"preview": ["skip", "mute"],
"hook": ["skip", "mute"],
"filler": ["skip", "mute"],
"music_offtopic": ["skip"],
"poi_highlight": ["poi"],
@@ -24,6 +25,7 @@
"intro": "https://wiki.sponsor.ajay.app/w/Intermission/Intro_Animation",
"outro": "https://wiki.sponsor.ajay.app/w/Endcards/Credits",
"preview": "https://wiki.sponsor.ajay.app/w/Preview/Recap",
"hook": "https://wiki.sponsor.ajay.app/w/Hook/Greetings",
"filler": "https://wiki.sponsor.ajay.app/w/Tangents/Jokes",
"music_offtopic": "https://wiki.sponsor.ajay.app/w/Music:_Non-Music_Section",
"poi_highlight": "https://wiki.sponsor.ajay.app/w/Highlight",

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "5.13.4",
"version": "5.14",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",

View File

@@ -11,6 +11,7 @@ import { asyncRequestToServer } from "../utils/requests";
import { defaultPreviewTime } from "../utils/constants";
import { getVideo, getVideoDuration } from "../../maze-utils/src/video";
import { AnimationUtils } from "../../maze-utils/src/animationUtils";
import { Tooltip } from "../render/Tooltip";
export interface SponsorTimeEditProps {
index: number;
@@ -494,6 +495,23 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
return;
}
// Hook update
if (!Config.config.hookUpdate && chosenCategory === "preview") {
Config.config.hookUpdate = true;
const target = event.target.closest(".sponsorSkipNotice tbody");
if (target) {
new Tooltip({
text: chrome.i18n.getMessage("hookNewFeature"),
referenceNode: target.parentElement,
prependElement: target as HTMLElement,
bottomOffset: "30px",
opacity: 0.9,
timeout: 100
});
}
}
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
this.handleReplacingLostTimes(chosenCategory, sponsorTime.actionType, sponsorTime);
this.saveEditTimes();

View File

@@ -62,6 +62,7 @@ interface SBConfig {
};
scrollToEditTimeUpdate: boolean;
categoryPillUpdate: boolean;
hookUpdate: boolean;
showChapterInfoMessage: boolean;
darkMode: boolean;
showCategoryGuidelines: boolean;
@@ -335,6 +336,7 @@ const syncDefaults = {
skipNonMusicOnlyOnYoutubeMusic: false,
scrollToEditTimeUpdate: false, // false means the tooltip will be shown
categoryPillUpdate: false,
hookUpdate: false,
showChapterInfoMessage: true,
darkMode: true,
showCategoryGuidelines: true,
@@ -459,6 +461,14 @@ const syncDefaults = {
color: "#005799",
opacity: "0.7"
},
"hook": {
color: "#395699",
opacity: "0.8"
},
"preview-hook": {
color: "#273963",
opacity: "0.7"
},
"music_offtopic": {
color: "#ff9900",
opacity: "0.7"

View File

@@ -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,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
@@ -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";
}

View File

@@ -98,6 +98,23 @@ export function getGuidelineInfo(category: Category): TextBox[] {
icon: "icons/right-arrow.svg",
text: chrome.i18n.getMessage(`generic_guideline2`)
}];
case "hook":
return [{
icon: "icons/campaign.svg",
text: chrome.i18n.getMessage(`category_${category}_guideline1`)
}, {
icon: "icons/check-smaller.svg",
text: chrome.i18n.getMessage(`category_${category}_guideline2`)
}, {
icon: "icons/close-smaller.svg",
text: chrome.i18n.getMessage(`category_${category}_guideline3`)
}, {
icon: "icons/segway.png",
text: chrome.i18n.getMessage(`generic_guideline1`)
}, {
icon: "icons/right-arrow.svg",
text: chrome.i18n.getMessage(`generic_guideline2`)
}];
case "filler":
return [{
icon: "icons/stopwatch.svg",