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