mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bca508004 | ||
|
|
42ff5f0092 | ||
|
|
8c2258a331 | ||
|
|
44177b9ddf | ||
|
|
33c939281c | ||
|
|
f4d2558856 |
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Submodule maze-utils updated: 33f0b5b757...e2f19e21c2
Submodule public/_locales updated: 9469b109c2...c9dcf1ec21
@@ -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();
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user