Skip to content

Support debug bookmarklet in same-origin iframes - #206

Merged
MattiasBuelens merged 1 commit into
mainfrom
devin/1791466123-bookmarklet-iframes
Oct 8, 2026
Merged

MattiasBuelens merged 1 commit into
mainfrom
devin/1791466123-bookmarklet-iframes

Conversation

@MattiasBuelens

Copy link
Copy Markdown
Collaborator

Summary

The debug display bookmarklet now also finds Open Video UI players inside same-origin iframes, including nested ones. Many of our demo pages embed their player this way.

Each frame has its own customElements registry, and Lit's constructed stylesheets can't be shared across documents. So the top-level run doesn't create panels inside other frames itself:

top-level run:
  for each accessible document (recursing through window.frames; cross-origin frames are skipped):
    supported UIs found?
      doc === document || doc's registry already has <theoplayer-debug-display>  → toggle directly
      otherwise → inject <script src=currentScript.src data-theoplayer-debug-frame> into that doc
  nothing supported anywhere → alert (top window only)

injected copy (data-theoplayer-debug-frame): toggle UIs in its own document only; no recursion, no alert

New panels are now created with ui.ownerDocument.createElement(...).

When the only UIs found are older than 2.6.0 (no overlay slot), the alert now includes the version it detected. That version comes from the version getter or, on UMD pages, from window.THEOplayerUI.version, e.g.:

Open Video UI 2.4.1 found, but the debug display requires Open Video UI 2.6.0 or higher.

The guide now mentions that players in same-origin iframes are supported, and there is a patch changeset.

Tested in Chrome by serving the local build in place of the jsDelivr URL:

Bookmarklet on the basic player docs page

Link to Devin session: https://dolby.devinenterprise.com/sessions/50ad8a122b354986bcfc78390b5a7f00
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/50ad8a122b354986bcfc78390b5a7f00?variant=devin
Requested by: @MattiasBuelens

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@changeset-bot

changeset-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2024190

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@theoplayer/web-ui Patch
@theoplayer/react-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@MattiasBuelens
MattiasBuelens merged commit c6580b0 into main Oct 8, 2026
1 check passed
@MattiasBuelens
MattiasBuelens deleted the devin/1791466123-bookmarklet-iframes branch October 8, 2026 13:46
@theoplayer-bot theoplayer-bot Bot mentioned this pull request Oct 8, 2026
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