Skip to content

Fix PiP not finding video in iframes/shadow DOM - #6

Open
Amitind wants to merge 1 commit into
levelsio:mainfrom
Amitind:fix-pip-iframe-shadow-dom
Open

Fix PiP not finding video in iframes/shadow DOM#6
Amitind wants to merge 1 commit into
levelsio:mainfrom
Amitind:fix-pip-iframe-shadow-dom

Conversation

@Amitind

@Amitind Amitind commented Aug 26, 2026

Copy link
Copy Markdown

Summary

  • Picture-in-Picture only searched document.querySelectorAll("video") on the top-level document, so it reported "No video found" on sites that embed the player in an iframe or shadow DOM (common embeds, Reddit/Twitch-style custom players).
  • Now runs the PiP script in all frames (allFrames: true) and recursively walks open shadow roots for <video>, picking whichever frame actually found/entered a video.

Test plan

  • Load unpacked extension, click PiP on a page with a directly-embedded <video> (regression check)
  • Click PiP on a page where the video lives inside an iframe
  • Click PiP on a page using shadow-DOM custom video controls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant