diff options
author | Ajay <[email protected]> | 2022-02-08 19:47:42 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2022-02-08 19:47:42 -0500 |
commit | 5ace92dc8b5be6538cf93ec348691a71d929272d (patch) | |
tree | 14896c9c2278bf315d533365b6c311ae954f07b5 | |
parent | bb490bf7ad4bedd904109437e2e184826b3cb5b6 (diff) | |
download | SponsorBlock-5ace92dc8b5be6538cf93ec348691a71d929272d.tar.gz SponsorBlock-5ace92dc8b5be6538cf93ec348691a71d929272d.zip |
Use current video time if performance.now is restricted (fingerprinting)
-rw-r--r-- | src/content.ts | 4 |
1 files 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 { |