Compare commits

..

18 Commits
5.8.1 ... 5.9.3

Author SHA1 Message Date
Ajay
e4b05a316a bump version 2024-09-27 15:50:18 -04:00
Ajay
451ceb370b Fix keybinds not working at all 2024-09-27 15:50:10 -04:00
Ajay
ab5291702a bump version 2024-09-27 02:06:20 -04:00
Ajay
bec183d595 Fix not allowing you to type ' in live chats 2024-09-27 02:06:08 -04:00
Ajay
a2f4f34dfe bump version 2024-09-26 19:27:30 -04:00
Ajay
7ba6fee9e5 Add more room for server-side rendering check 2024-09-26 19:26:01 -04:00
Ajay
9d9713ee82 Attempt to fix issue with autoplay disabled on some browser breaking skipping
Fix #2074 and Fix #2078
2024-09-26 19:18:30 -04:00
Ajay
91556f981a Remove unnecessary log
Fix #2111
2024-09-23 16:00:17 -04:00
Ajay
9f86aa6740 bump version 2024-09-23 04:07:50 -04:00
Ajay
466573e2a4 update translations 2024-09-23 04:07:36 -04:00
Ajay
4c417b10fe Make sure old segment fetch request doesn't get used
May fix #2101

See dbf80b4929 (r147058589)
2024-09-23 04:05:20 -04:00
Ajay
36549e7898 Fix chapter box title selector 2024-09-23 03:58:11 -04:00
Ajay
0d2d5f2eb0 try to improve chapters importing 2024-09-23 03:46:19 -04:00
Ajay
e089b83797 Improve timeout waiting error 2024-09-23 03:32:33 -04:00
Ajay
dbd0d157a8 Fix preview bar not appearing on mobile due to new layout
Fixes #2109
2024-09-23 01:37:11 -04:00
Ajay
aef2b113f8 Remove legacy keybdind check 2024-09-12 19:45:35 -04:00
Ajay
e610e03e46 Make submission menu keyboard of ff not open find menu 2024-09-12 19:44:35 -04:00
Ajay
17cbd068b9 Add size limit to description for edge 2024-09-08 01:32:58 -04:00
7 changed files with 26 additions and 28 deletions

View File

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

View File

@@ -75,7 +75,6 @@ let sponsorTimes: SponsorTime[] = [];
let existingChaptersImported = false;
let importingChaptersWaitingForFocus = false;
let importingChaptersWaiting = false;
let triedImportingChapters = false;
// List of open skip notices
const skipNotices: SkipNotice[] = [];
let activeSkipKeybindElement: ToggleSkippable = null;
@@ -395,7 +394,6 @@ function resetValues() {
sponsorTimes = [];
existingChaptersImported = false;
triedImportingChapters = false;
sponsorSkipped = [];
lastResponseStatus = 0;
shownSegmentFailedToFetchWarning = false;
@@ -512,12 +510,8 @@ function handleMobileControlsMutations(): void {
function getPreviewBarAttachElement(): HTMLElement | null {
const progressElementOptions = [{
// For new mobile YouTube (#1287)
selector: ".progress-bar-line",
isVisibleCheck: true
}, {
// For newer mobile YouTube (Jan 2024)
selector: ".YtProgressBarProgressBarLine",
// For newer mobile YouTube (Sept 2024)
selector: ".YtChapteredProgressBarHost",
isVisibleCheck: true
}, {
// For newer mobile YouTube (May 2024)
@@ -858,6 +852,7 @@ let lastPlaybackSpeed = 1;
let setupVideoListenersFirstTime = true;
function setupVideoListeners() {
const video = getVideo();
if (!video) return; // Maybe video became invisible
//wait until it is loaded
video.addEventListener('loadstart', videoOnReadyListener)
@@ -1139,7 +1134,7 @@ function setupCategoryPill() {
}
async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
const videoID = getVideoID()
const videoID = getVideoID();
if (!videoID) {
console.error("[SponsorBlock] Attempted to fetch segments with a null/undefined videoID.");
return;
@@ -1147,6 +1142,9 @@ async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
const segmentData = await getSegmentsForVideo(videoID, ignoreCache);
// Make sure an old pending request doesn't get used.
if (videoID !== getVideoID()) return;
// store last response status
lastResponseStatus = segmentData.status;
if (segmentData.status === 200) {
@@ -1238,7 +1236,7 @@ async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
}
function importExistingChapters(wait: boolean) {
if (!existingChaptersImported && !importingChaptersWaiting && !triedImportingChapters && onVideoPage() && !isOnMobileYouTube()) {
if (!existingChaptersImported && !importingChaptersWaiting && onVideoPage() && !isOnMobileYouTube()) {
const waitCondition = () => getVideoDuration() && getExistingChapters(getVideoID(), getVideoDuration());
if (wait && !document.hasFocus() && !importingChaptersWaitingForFocus && !waitCondition()) {
@@ -1259,7 +1257,7 @@ function importExistingChapters(wait: boolean) {
existingChaptersImported = true;
updatePreviewBar();
}
}).catch(() => { importingChaptersWaiting = false; triedImportingChapters = true; }); // eslint-disable-line @typescript-eslint/no-empty-function
}).catch(() => { importingChaptersWaiting = false; }); // eslint-disable-line @typescript-eslint/no-empty-function
}
}
}
@@ -2525,8 +2523,10 @@ function addHotkeyListener(): void {
}
function hotkeyListener(e: KeyboardEvent): void {
if (["textarea", "input"].includes(document.activeElement?.tagName?.toLowerCase())
|| document.activeElement?.id?.toLowerCase()?.includes("editable")) return;
if ((["textarea", "input"].includes(document.activeElement?.tagName?.toLowerCase())
|| document.activeElement?.["contentEditable"] === "true"
|| document.activeElement?.id?.toLowerCase()?.match(/editable|input/))
&& document.hasFocus()) return;
const key: Keybind = {
key: e.key,
@@ -2571,6 +2571,8 @@ function hotkeyListener(e: KeyboardEvent): void {
submitSegments();
return;
} else if (keybindEquals(key, openSubmissionMenuKey)) {
e.preventDefault();
openSubmissionMenu();
return;
} else if (keybindEquals(key, previewKey)) {
@@ -2585,16 +2587,6 @@ function hotkeyListener(e: KeyboardEvent): void {
previousChapter();
return;
}
//legacy - to preserve keybinds for skipKey, startSponsorKey and submitKey for people who set it before the update. (shouldn't be changed for future keybind options)
if (key.key == skipKey?.key && skipKey.code == null && !keybindEquals(Config.syncDefaults.skipKeybind, skipKey)) {
if (activeSkipKeybindElement)
activeSkipKeybindElement.toggleSkip.call(activeSkipKeybindElement);
} else if (key.key == startSponsorKey?.key && startSponsorKey.code == null && !keybindEquals(Config.syncDefaults.startSponsorKeybind, startSponsorKey)) {
startOrEndTimingNewSegment();
} else if (key.key == submitKey?.key && submitKey.code == null && !keybindEquals(Config.syncDefaults.submitKeybind, submitKey)) {
openSubmissionMenu();
}
}
/**

View File

@@ -197,7 +197,6 @@ class PreviewBar {
if (this.onMobileYouTube) {
this.container.style.transform = "none";
this.container.style.height = "var(--yt-progress-bar-height)";
} else if (!this.onInvidious) {
this.container.classList.add("sbNotInvidious");
}

View File

@@ -55,7 +55,7 @@ export function getHashParams(): Record<string, unknown> {
export function getExistingChapters(currentVideoID: VideoID, duration: number): SponsorTime[] {
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
const title = document.querySelector("[target-id=engagement-panel-macro-markers-auto-chapters] #title-text");
const title = chaptersBox?.closest("ytd-engagement-panel-section-list-renderer")?.querySelector("#title-text.ytd-engagement-panel-title-header-renderer");
if (title?.textContent?.includes("Key moment")) return [];
const chapters: SponsorTime[] = [];

View File

@@ -170,6 +170,13 @@ module.exports = env => {
parsed.Description.message = parsed.Description.message.slice(0, 77) + "...";
}
}
if (env.browser.toLowerCase() === "edge") {
parsed.Description.message = parsed.Description.message.match(/^.+(?=\. )/)?.[0] || parsed.Description.message;
if (parsed.Description.message.length > 132) {
parsed.Description.message = parsed.Description.message.slice(0, 129) + "...";
}
}
return Buffer.from(JSON.stringify(parsed));
}