From 6cd2d4cf83ce0f471242002b7a1ece1fd35fbbaf Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 18 Feb 2020 18:44:06 -0500 Subject: [PATCH] Added back whitelist support --- src/content.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/content.ts b/src/content.ts index 8d06bb66..07ff57f8 100644 --- a/src/content.ts +++ b/src/content.ts @@ -435,17 +435,19 @@ function cancelSponsorSchedule(): void { function startSponsorSchedule(currentTime?: number): void { cancelSponsorSchedule(); - if (Config.config.disableSkipping || sponsorTimes === null) return; + if (sponsorTimes === null || Config.config.disableSkipping || channelWhitelisted){ + return; + } if (currentTime === undefined) currentTime = video.currentTime; let skipInfo = getNextSkipIndex(currentTime); - let skipStartTime = skipInfo.array[skipInfo.index][0]; - let timeUntilSponsor = skipStartTime - currentTime; + let skipTime = skipInfo.array[skipInfo.index]; + let timeUntilSponsor = skipTime[0] - currentTime; currentSkipSchedule = setTimeout(() => { - if (video.currentTime >= skipStartTime) { + if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) { skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice); startSponsorSchedule();