From 2b3c812f8a7641b6a0c3b3b7508dfbe576347133 Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 23 May 2022 21:41:35 -0400 Subject: [PATCH] Some more debug logs --- src/content.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content.ts b/src/content.ts index a203582a..56b08571 100644 --- a/src/content.ts +++ b/src/content.ts @@ -575,6 +575,8 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?: // Use interval instead of timeout near the end to combat imprecise video time const startIntervalTime = performance.now(); const startVideoTime = Math.max(currentTime, video.currentTime); + logDebug(`Starting setInterval skipping ${video.currentTime} to skip at ${skipTime[0]}`); + currentSkipInterval = setInterval(() => { const intervalDuration = performance.now() - startIntervalTime; if (intervalDuration >= delayTime || video.currentTime >= skipTime[0]) { @@ -589,6 +591,8 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?: } }, 1); } else { + logDebug(`Starting timeout to skip ${video.currentTime} to skip at ${skipTime[0]}`); + // Schedule for right before to be more precise than normal timeout currentSkipSchedule = setTimeout(skippingFunction, Math.max(0, delayTime - 100)); }