Compare commits

..

5 Commits

Author SHA1 Message Date
Ajay
1074f653b2 bump version 2025-05-16 02:17:05 -04:00
Ajay
a12601180e update translations 2025-05-16 02:16:57 -04:00
Ajay
3a7716240d Fix time without skip for new yt player
Fixes #2263
2025-05-14 01:24:54 -04:00
Ajay Ramachandran
93f44859b2 Merge pull request #2255 from mini-bomba/useragent
Use useragent generator from maze-utils
2025-04-28 01:26:39 -04:00
mini-bomba
376ce21eae Use useragent generator from maze-utils 2025-04-26 19:39:58 +02:00
5 changed files with 9 additions and 8 deletions

View File

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

View File

@@ -33,7 +33,7 @@ import { logDebug, logWarn } from "./utils/logger";
import { importTimes } from "./utils/exporter"; import { importTimes } from "./utils/exporter";
import { ChapterVote } from "./render/ChapterVote"; import { ChapterVote } from "./render/ChapterVote";
import { openWarningDialog } from "./utils/warnings"; import { openWarningDialog } from "./utils/warnings";
import { isFirefoxOrSafari, waitFor } from "../maze-utils/src"; import { extensionUserAgent, isFirefoxOrSafari, waitFor } from "../maze-utils/src";
import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating"; import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube, isOnYouTubeMusic, isOnYTTV, getLastNonInlineVideoID, triggerVideoIDChange, triggerVideoElementChange, getIsInline, getCurrentTime, setCurrentTime, getVideoDuration, verifyCurrentTime, waitForVideo } from "../maze-utils/src/video"; import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube, isOnYouTubeMusic, isOnYTTV, getLastNonInlineVideoID, triggerVideoIDChange, triggerVideoElementChange, getIsInline, getCurrentTime, setCurrentTime, getVideoDuration, verifyCurrentTime, waitForVideo } from "../maze-utils/src/video";
import { Keybind, StorageChangesObject, isSafari, keybindEquals, keybindToString } from "../maze-utils/src/config"; import { Keybind, StorageChangesObject, isSafari, keybindEquals, keybindToString } from "../maze-utils/src/config";
@@ -2470,7 +2470,7 @@ async function sendSubmitMessage(): Promise<boolean> {
userID: Config.config.userID, userID: Config.config.userID,
segments: sponsorTimesSubmitting, segments: sponsorTimesSubmitting,
videoDuration: getVideoDuration(), videoDuration: getVideoDuration(),
userAgent: `${chrome.runtime.id}/v${chrome.runtime.getManifest().version}` userAgent: extensionUserAgent(),
}); });
if (response.status === 200) { if (response.status === 200) {
@@ -2762,7 +2762,7 @@ function showTimeWithoutSkips(skippedDuration: number): void {
isOnInvidious() ? ".vjs-duration" : isOnInvidious() ? ".vjs-duration" :
isOnYTTV() ? ".ypl-full-controls .ypmcs-control .time-info-bar" : isOnYTTV() ? ".ypl-full-controls .ypmcs-control .time-info-bar" :
isOnMobileYouTube() ? ".ytwPlayerTimeDisplayContent" : isOnMobileYouTube() ? ".ytwPlayerTimeDisplayContent" :
".ytp-time-display.notranslate .ytp-time-wrapper"; ".ytp-time-display.notranslate .ytp-time-wrapper .ytp-time-contents";
const display = document.querySelector(selector); const display = document.querySelector(selector);
if (!display) return; if (!display) return;

View File

@@ -5,6 +5,7 @@ import * as CompileConfig from "../../config.json";
import { ActionType, ActionTypes, SponsorSourceType, SponsorTime, VideoID } from "../types"; import { ActionType, ActionTypes, SponsorSourceType, SponsorTime, VideoID } from "../types";
import { getHashParams } from "./pageUtils"; import { getHashParams } from "./pageUtils";
import { asyncRequestToServer } from "./requests"; import { asyncRequestToServer } from "./requests";
import { extensionUserAgent } from "../../maze-utils/src";
const segmentDataCache = new DataCache<VideoID, SegmentResponse>(() => { const segmentDataCache = new DataCache<VideoID, SegmentResponse>(() => {
return { return {
@@ -57,7 +58,7 @@ async function fetchSegmentsForVideo(videoID: VideoID): Promise<SegmentResponse>
trimUUIDs: hasDownvotedSegments ? null : 5, trimUUIDs: hasDownvotedSegments ? null : 5,
...extraRequestData ...extraRequestData
}, { }, {
"X-CLIENT-NAME": `${chrome.runtime.id}/v${chrome.runtime.getManifest().version}` "X-CLIENT-NAME": extensionUserAgent(),
}); });
if (response.ok) { if (response.ok) {
@@ -103,4 +104,4 @@ function getEnabledActionTypes(forceFullVideo = false): ActionType[] {
} }
return actionTypes; return actionTypes;
} }