diff --git a/extension/content.js b/extension/content.js index 8e8bdd9..cfa29f6 100644 --- a/extension/content.js +++ b/extension/content.js @@ -567,7 +567,7 @@ // --- Helper: find the best video element on the page --- // Prefers larger, visible videos over tiny preview/trailer elements. - function findVideo(root = document) { + function findVideo(root = document, depth = 0) { const candidates = Array.from(root.querySelectorAll('video')); // Scan likely media hosts even when light-DOM videos exist; many players @@ -575,7 +575,21 @@ const potentialHosts = root.querySelectorAll('[id*="player" i], [class*="player" i], [id*="video" i], [class*="video" i], [id*="media" i], [class*="media" i], [id*="stream" i], [class*="stream" i], ytd-player, netflix-player, emby-player, jellyfin-player, video-player'); for (const el of potentialHosts) { if (el.shadowRoot) { - const found = findVideo(el.shadowRoot); + const found = findVideo(el.shadowRoot, depth); + if (found) candidates.push(found); + } + } + + // Same-origin player frames (jkanime.net and similar) keep the real + //