Files
Terence Cho 47fb33785a fix(runtime): fall back to setInterval when rAF is throttled in nested iframes
Chromium throttles requestAnimationFrame in deeply nested cross-origin
iframes — specifically the composition iframe inside an MCP widget
rendered in Claude desktop (Electron). Because the HyperFrames runtime
drives all animation by seeking GSAP on each rAF tick rather than
letting GSAP run freely, a stalled rAF loop means no animation, even
when the TransportClock is in the playing state.

Add a setInterval fallback at 16 ms alongside the primary rAF loop.
The interval is a no-op when rAF is healthy (fires within the last 100 ms);
it takes over only when rAF is starved. Interval-driven ticks do not
reschedule rAF (avoids handle accumulation), and do not update lastRafMs
(so the interval keeps firing until rAF resumes). When rAF does resume,
lastRafMs is updated and the interval goes dormant again.

Fixes autoplay and the play button in Claude desktop's MCP widget.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 20:05:52 -07:00
..
2026-05-10 18:34:43 +00:00
2026-05-10 18:34:43 +00:00