From 5ace92dc8b5be6538cf93ec348691a71d929272d Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 8 Feb 2022 19:47:42 -0500 Subject: [PATCH] Use current video time if performance.now is restricted (fingerprinting) --- src/content.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content.ts b/src/content.ts index e8c7f0fb..38316dbf 100644 --- a/src/content.ts +++ b/src/content.ts @@ -538,9 +538,9 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?: currentSkipInterval = setInterval(() => { const intervalDuration = performance.now() - startIntervalTime; console.log(startVideoTime + intervalDuration / 1000) - if (intervalDuration >= delayTime) { + if (intervalDuration >= delayTime || video.currentTime >= skipTime[0]) { clearInterval(currentSkipInterval); - skippingFunction(startVideoTime + intervalDuration / 1000); + skippingFunction(Math.max(video.currentTime, startVideoTime + intervalDuration / 1000)); } }, 5); } else {