mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-15 16:07:06 +03:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43c30bb03d | ||
|
|
eac2caadce | ||
|
|
8d0a4ec2e6 | ||
|
|
8b6fb98b3d | ||
|
|
8f13c5b8a5 |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "__MSG_fullName__",
|
||||
"short_name": "SponsorBlock",
|
||||
"version": "5.1.7",
|
||||
"version": "5.1.8",
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_Description__",
|
||||
"homepage_url": "https://sponsor.ajay.app",
|
||||
|
||||
@@ -154,6 +154,7 @@ let isAdPlaying = false;
|
||||
|
||||
let lastResponseStatus: number;
|
||||
let retryCount = 0;
|
||||
let lookupWaiting = false;
|
||||
|
||||
// Contains all of the functions and variables needed by the skip notice
|
||||
const skipNoticeContentContainer: ContentContainer = () => ({
|
||||
@@ -965,10 +966,15 @@ function setupCategoryPill() {
|
||||
}
|
||||
|
||||
async function sponsorsLookup(keepOldSubmissions = true) {
|
||||
if (lookupWaiting) return;
|
||||
if (!video || !isVisible(video)) refreshVideoAttachments();
|
||||
//there is still no video here
|
||||
if (!video) {
|
||||
setTimeout(() => sponsorsLookup(), 100);
|
||||
lookupWaiting = true;
|
||||
setTimeout(() => {
|
||||
lookupWaiting = false;
|
||||
sponsorsLookup()
|
||||
}, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1198,7 +1204,7 @@ function retryFetch(errorCode: number): void {
|
||||
retryFetchTimeout = setTimeout(() => {
|
||||
if (sponsorVideoID && sponsorTimes?.length === 0
|
||||
|| sponsorTimes.every((segment) => segment.source !== SponsorSourceType.Server)) {
|
||||
sponsorsLookup();
|
||||
// sponsorsLookup();
|
||||
}
|
||||
}, delay);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ type WindowMessage = StartMessage | FinishMessage | AdMessage | VideoData;
|
||||
// global playerClient - too difficult to type
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let playerClient: any;
|
||||
let lastVideo = "";
|
||||
|
||||
const sendMessage = (message: WindowMessage): void => {
|
||||
window.postMessage({ source: "sponsorblock", ...message }, "/");
|
||||
@@ -87,7 +88,8 @@ function navigateFinishSend(event: CustomEvent): void {
|
||||
function sendVideoData(): void {
|
||||
if (!playerClient) return;
|
||||
const videoData = playerClient.getVideoData();
|
||||
if (videoData) {
|
||||
if (videoData && videoData.video_id !== lastVideo) {
|
||||
lastVideo = videoData.video_id;
|
||||
sendMessage({ type: "data", videoID: videoData.video_id, isLive: videoData.isLive, isPremiere: videoData.isPremiere } as VideoData);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user