mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 15:07:02 +03:00
Fix full video label sometimes not appearing when you open a video in a background tab
This commit is contained in:
Submodule maze-utils updated: 6770087140...7a49dc6d5e
@@ -35,7 +35,7 @@ import { ChapterVote } from "./render/ChapterVote";
|
|||||||
import { openWarningDialog } from "./utils/warnings";
|
import { openWarningDialog } from "./utils/warnings";
|
||||||
import { isFirefoxOrSafari, waitFor } from "../maze-utils/src";
|
import { 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, getLastNonInlineVideoID, triggerVideoIDChange, triggerVideoElementChange, getIsInline, getCurrentTime, setCurrentTime, getVideoDuration, verifyCurrentTime } from "../maze-utils/src/video";
|
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube, 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";
|
||||||
import { findValidElement } from "../maze-utils/src/dom"
|
import { findValidElement } from "../maze-utils/src/dom"
|
||||||
import { getHash, HashedValue } from "../maze-utils/src/hash";
|
import { getHash, HashedValue } from "../maze-utils/src/hash";
|
||||||
@@ -1230,7 +1230,7 @@ async function sponsorsLookup(keepOldSubmissions = true, ignoreCache = false) {
|
|||||||
|
|
||||||
if (!getVideo()) {
|
if (!getVideo()) {
|
||||||
//there is still no video here
|
//there is still no video here
|
||||||
await waitFor(() => getVideo(), 5000, 10);
|
await waitForVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
startSkipScheduleCheckingForStartSponsors();
|
startSkipScheduleCheckingForStartSponsors();
|
||||||
@@ -1375,7 +1375,9 @@ function startSkipScheduleCheckingForStartSponsors() {
|
|||||||
|
|
||||||
const fullVideoSegment = sponsorTimes.filter((time) => time.actionType === ActionType.Full)[0];
|
const fullVideoSegment = sponsorTimes.filter((time) => time.actionType === ActionType.Full)[0];
|
||||||
if (fullVideoSegment) {
|
if (fullVideoSegment) {
|
||||||
categoryPill?.setSegment(fullVideoSegment);
|
waitFor(() => categoryPill).then(() => {
|
||||||
|
categoryPill?.setSegment(fullVideoSegment);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startingSegmentTime !== -1) {
|
if (startingSegmentTime !== -1) {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export class CategoryPill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async attachToPageInternal(): Promise<void> {
|
private async attachToPageInternal(): Promise<void> {
|
||||||
let referenceNode =
|
let referenceNode =
|
||||||
await waitFor(() => getYouTubeTitleNode());
|
await waitFor(() => getYouTubeTitleNode());
|
||||||
|
|
||||||
// Experimental YouTube layout with description on right
|
// Experimental YouTube layout with description on right
|
||||||
@@ -119,6 +119,8 @@ export class CategoryPill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setSegment(segment: SponsorTime): Promise<void> {
|
async setSegment(segment: SponsorTime): Promise<void> {
|
||||||
|
await waitFor(() => this.ref.current);
|
||||||
|
|
||||||
if (this.ref.current?.state?.segment !== segment) {
|
if (this.ref.current?.state?.segment !== segment) {
|
||||||
const newState = {
|
const newState = {
|
||||||
segment,
|
segment,
|
||||||
|
|||||||
Reference in New Issue
Block a user