diff --git a/inject.js b/inject.js index 0d6929b..66c57cd 100644 --- a/inject.js +++ b/inject.js @@ -627,7 +627,26 @@ function sanitizeSpeed(speed, fallback) { } function getVideoSourceKey(video) { - return (video && (video.currentSrc || video.src)) || "unknown_src"; + if (!video) return "unknown_src"; + + var docLocation = + video.ownerDocument && + video.ownerDocument.location && + video.ownerDocument.location.href + ? video.ownerDocument.location + : location; + + var hostname = (docLocation && docLocation.hostname) || ""; + if ( + hostname.includes("youtube.com") || + hostname.includes("youtube-nocookie.com") + ) { + // YouTube frequently reuses the same