Jake Archibald
Read post

Firefox + custom elements + iframes bug

This post discusses a bug encountered when using custom elements within iframes in Firefox. The issue occurs because custom elements lose their prototype when moved between JavaScript Realms, causing instance methods to disappear. A simple fix is provided by reinstating the prototype using a base class and adopting specific callbacks.

    #javascript#firefox#web-components
Feb 14, 2025•3m read time•From jakearchibald.com
Post cover image
Table of contents
The bugThe fix
8 Impressions
Jake Archibald's image
Jake Archibald

JakeArchibald provides insights into web performance optimization and frontend development best prac...

11 Followers

•

101 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard