From 6d7953a1ca4083e533976163b6933c26bf218590 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 24 Mar 2023 15:51:36 -0400 Subject: [PATCH] Fix potentially leaking set interval --- src/content.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content.ts b/src/content.ts index 1f1315ea..e013099b 100644 --- a/src/content.ts +++ b/src/content.ts @@ -684,6 +684,7 @@ async function startSponsorSchedule(includeIntersectingSegments = false, current const reportedVideoTimeAtStart = getVideo().currentTime; logDebug(`Starting setInterval skipping ${getVideo().currentTime} to skip at ${skipTime[0]}`); + if (currentSkipInterval !== null) clearInterval(currentSkipInterval); currentSkipInterval = setInterval(() => { // Estimate delay, but only take the current time right after a change // Current time remains the same for many "frames" on Firefox