---
title: "Firefox + custom elements + iframes bug"
url: https://daily.dev/posts/firefox-custom-elements-iframes-bug-s2biku2jc
source_url: https://jakearchibald.com/2025/firefox-custom-elements-iframes-bug/
type: article
source: "Jake Archibald"
published: 2025-02-14T15:22:37.054Z
updated: 2025-02-14T15:22:50.177Z
tags: ["javascript", "firefox", "web-components"]
reading_time: 3
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Firefox + custom elements + iframes bug

**[Jake Archibald](https://daily.dev/sources/jakearchibald)** · 3 min read · 0 upvotes · 0 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://jakearchibald.com/2025/firefox-custom-elements-iframes-bug/>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#firefox](https://daily.dev/tags/firefox), [#web-components](https://daily.dev/tags/web-components)

[View this post on daily.dev](https://daily.dev/posts/firefox-custom-elements-iframes-bug-s2biku2jc)
