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)); }