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.

3m read timeFrom jakearchibald.com
Post cover image
Table of contents
The bugThe fix

Sort: