-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsfiddle.net - The iframe content is not displayed #56877
Comments
Thanks for the report. I was indeed able to reproduce the issue. Tested with: This is the web page displayed in Firefox Nightly: And this is the web page displayed in Chrome: Moving the issue to needsdiagnosis. |
Thanks much for the report, @xerz-one! You're right, this is indeed a weird issue. I looked into this and was quite confused as I've never seen that before, but as it turns out, this is a known edge-case with iFrame load timings. Your code is correctly assigning the value, but unfortunately, shortly after that, the "iframe finishes loading" and thus the original content gets repainted. This appears to be a very niche edgecase, as we've not seen any actual site breakage caused by this so far, but I'll make sure to properly tag the original report. Luckily, there is a simple workaround for that, though. You can listen to the iFrame's -iframe.contentWindow.document.documentElement.replaceWith(
- doc.documentElement
-);
+iframe.addEventListener('load', (ev) => {
+ ev.target.contentWindow.document.documentElement.replaceWith(
+ doc.documentElement
+ );
+}); would make this work as expected. Hope this helps. I'll close this bug as a duplicate of bug 728151. |
@denschub Thanks for the quick response! Sadly, it seems that workaround does the inverse effect and fixes the issue in Firefox while breaking the page in Chromium and GNOME Web. Is this a compatibility bug with those browsers? Regardless, is there any workaround that meets full compatibility? |
On a first glance, the spec looks like it says that the |
Ah, actually, no. Both browsers do fire the load event, but Chrome does it synchronously directly after the In any case, for you, this should not matter: just make sure to |
URL: https://jsfiddle.net/gh08oLbq/
Browser / Version: Firefox 79.0
Operating System: Linux
Tested Another Browser: Yes Chrome
Problem type: Site is not usable
Description: Page not loading correctly
Steps to Reproduce:
When loading a custom
documentElement
into aniframe
by replacing the original one, the content is initially displayed but disappears within milliseconds, leaving no items in the DOM tree. This issue is specific to Firefox as it does not happen in Chromium or GNOME Web.Browser Configuration
View console log messages
From webcompat.com with ❤️
The text was updated successfully, but these errors were encountered: