We have an application that mostly deals with iframes (loads the different pages within the application on demand)
Recently, the IE browser got updated with KB3154070(Current IE Version: 11.0.9600.18314) as part of the system updates. After that update, majority of the functionality is breaking completely. It effected all the pages that use iframes. The content is not loading and resulting in a blank page. The request appears to be aborted when inspected in the network panel as shown in the below screen capture. Network Traffic Capture
We have performed the following troubleshooting
We made sure that all iframe tags are close properly. The src of the iframe is not empty. If we access the same page outside (without loading into iframe), it works fine. But, the problem is with only within iframe. As a quick workaround to this problem, we have asked our users to roll back the update. But, this is not the expected solution.
Your help is really appreciated.
Regards, Swajay.
@Matt's answer provides a clue on how to workaround the problem. It appears that IE, with the KB3154070 installed, blocks iframe content if the iframe initiates any scripting operations before the parent DOM tree is ready. I have noticed no blocking occurs if resource loaded by iframe contains no scripting. I have also noticed that sometimes IE will not block content with scripting, but this is likely due to a race condition between parent DOM being ready and iframe resource loading.
Another observation is I have not seen any iframe loading problems when running IE in edge mode. It appears the problem only occurs when running in compatibility mode.
To workaround the problem for the project I work on, I stubbed the iframe, where I declare no value for the src attribute. In the main page's onload handler--which indicates the DOM tree is ready--I use javascript to set the src attribute of the iframe. Doing this appears to work, where the iframe gets properly loaded.
For example, say you have the following:
<iframe id="myIFrame"></iframe>
In your onload handler, you have something like:
document.getElementById('myIFrame').src = '/whatever/url/to/load';
I still think KB3154070 introduced a regression bug (if not bugs), but maybe what I have suggested can be applied to your application.
UPDATE
IE update KB317016 appears to fix the iframe loading problem. Microsoft has officially recognized the bug: KB3176757.
I plan on keeping my changes in place since some of our customers may not be able to update IE immediately. Also, the changes made still work in all versions of IE we need to support.
We ran into exactly the same problem. The issue in our specific case was that iframes now abort their requests when they are re-parented (i.e. moved from one DOM tree location to another). We were able to work around the new restriction by avoiding moving the iframe while it was loading. I can't be certain that's exactly what's happening in your case, but I'd wager it was some interaction occurring between the start of the iframe load and its completion.
My company legacy software was hugely impacted by this issue. We came up with the following generic solution until microsoft solves this bug:
$(document).ready(function() {
loadIframesIE();
});
function loadIframesIE() {
var $iframe;
$('iframe').each(function(cnt, iframe) {
$iframe = $(iframe);
// If the iframe body has no child, it couldn't be loaded
if ($iframe.contents().find('body').children().length === 0 && !$iframe.attr('resetted')) {
// Necessary to avoid an infinite loop in some cases
$iframe.attr('resetted', true);
$iframe.attr('src', $iframe.attr('src'));
}
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With