Skip to content

fix(embed): create emitter inside iframe load event#14

Closed
ihatexcel wants to merge 3 commits into
mainfrom
claude/setup-tsup-github-lib-KNfOE
Closed

fix(embed): create emitter inside iframe load event#14
ihatexcel wants to merge 3 commits into
mainfrom
claude/setup-tsup-github-lib-KNfOE

Conversation

@ihatexcel

Copy link
Copy Markdown
Owner

Emitter was created immediately after setting srcdoc, before the iframe document had loaded. With srcdoc, contentWindow can reference a stale browsing context during navigation, causing CHILD_READY to be missed or source-check to fail.

The fix follows the pattern from the reference example: add a 'load' listener on the iframe, create the emitter inside it so contentWindow is stable and CHILD_READY is already queued for delivery.

https://claude.ai/code/session_014XkyCi4sXUHdDjMstV2Pbt

claude and others added 3 commits May 11, 2026 11:03
Emitter was created immediately after setting srcdoc, before the iframe
document had loaded. With srcdoc, contentWindow can reference a stale
browsing context during navigation, causing CHILD_READY to be missed or
source-check to fail.

The fix follows the pattern from the reference example: add a 'load'
listener on the iframe, create the emitter inside it so contentWindow
is stable and CHILD_READY is already queued for delivery.

https://claude.ai/code/session_014XkyCi4sXUHdDjMstV2Pbt
New nav tab shows embed.html running in an iframe on the left, and its
complete raw source fetched via fetch() displayed in a <pre> on the right.
Both loaded lazily on first navigation. Source has a copy button.

https://claude.ai/code/session_014XkyCi4sXUHdDjMstV2Pbt
@ihatexcel ihatexcel closed this May 11, 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.

2 participants