Use useragent generator from maze-utils

This commit is contained in:
mini-bomba
2025-04-26 19:39:58 +02:00
parent 19635d2f06
commit 376ce21eae
3 changed files with 6 additions and 5 deletions

View File

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