mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-15 07:57:09 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8653059b13 | ||
|
|
b3afd0403e | ||
|
|
6db498ccb1 | ||
|
|
ef8c5f58c5 | ||
|
|
71998831ee | ||
|
|
8f19d3e83c |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "5.1.2",
|
"version": "5.1.4",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ interface SBConfig {
|
|||||||
showCategoryWithoutPermission: boolean;
|
showCategoryWithoutPermission: boolean;
|
||||||
showSegmentNameInChapterBar: boolean;
|
showSegmentNameInChapterBar: boolean;
|
||||||
useVirtualTime: boolean;
|
useVirtualTime: boolean;
|
||||||
|
showSegmentFailedToFetchWarning: boolean;
|
||||||
|
|
||||||
// Used to cache calculated text color info
|
// Used to cache calculated text color info
|
||||||
categoryPillColors: {
|
categoryPillColors: {
|
||||||
@@ -202,6 +203,7 @@ const Config: SBObject = {
|
|||||||
showCategoryWithoutPermission: false,
|
showCategoryWithoutPermission: false,
|
||||||
showSegmentNameInChapterBar: true,
|
showSegmentNameInChapterBar: true,
|
||||||
useVirtualTime: true,
|
useVirtualTime: true,
|
||||||
|
showSegmentFailedToFetchWarning: true,
|
||||||
|
|
||||||
categoryPillColors: {},
|
categoryPillColors: {},
|
||||||
|
|
||||||
|
|||||||
@@ -1926,7 +1926,8 @@ function startOrEndTimingNewSegment() {
|
|||||||
|
|
||||||
importExistingChapters(false);
|
importExistingChapters(false);
|
||||||
|
|
||||||
if (lastResponseStatus !== 200 && !shownSegmentFailedToFetchWarning) {
|
if (lastResponseStatus !== 200 && lastResponseStatus !== 404
|
||||||
|
&& !shownSegmentFailedToFetchWarning && Config.config.showSegmentFailedToFetchWarning) {
|
||||||
alert(chrome.i18n.getMessage("segmentFetchFailureWarning"));
|
alert(chrome.i18n.getMessage("segmentFetchFailureWarning"));
|
||||||
|
|
||||||
shownSegmentFailedToFetchWarning = true;
|
shownSegmentFailedToFetchWarning = true;
|
||||||
|
|||||||
@@ -728,8 +728,8 @@ class PreviewBar {
|
|||||||
|
|
||||||
private getPartialChapterSectionStyle(element: HTMLElement, param: string): number {
|
private getPartialChapterSectionStyle(element: HTMLElement, param: string): number {
|
||||||
const data = element.style[param];
|
const data = element.style[param];
|
||||||
if (data?.includes("100%")) {
|
if (data?.includes("%")) {
|
||||||
return 0;
|
return this.customChaptersBar.clientWidth * (parseFloat(data.replace("%", "")) / 100);
|
||||||
} else {
|
} else {
|
||||||
return parseInt(element.style[param].match(/\d+/g)?.[0]) || 0;
|
return parseInt(element.style[param].match(/\d+/g)?.[0]) || 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
|
|||||||
|
|
||||||
const chapters: SponsorTime[] = [];
|
const chapters: SponsorTime[] = [];
|
||||||
// .ytp-timed-markers-container indicates that key-moments are present, which should not be divided
|
// .ytp-timed-markers-container indicates that key-moments are present, which should not be divided
|
||||||
if (chaptersBox && !(document.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) {
|
if (chaptersBox && !(getControls()?.parentElement?.parentElement
|
||||||
|
?.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) {
|
||||||
let lastSegment: SponsorTime = null;
|
let lastSegment: SponsorTime = null;
|
||||||
const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a");
|
const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a");
|
||||||
for (const link of links) {
|
for (const link of links) {
|
||||||
|
|||||||
Reference in New Issue
Block a user