[whatwg] Avoiding synchronous iframe load

Ryosuke Niwa rniwa at apple.com
Thu Oct 17 01:04:19 PDT 2013


On Oct 15, 2013, at 7:02 PM, Ryosuke Niwa <rniwa at apple.com> wrote:
> I'm trying to make page loads on iframe always asynchronous in WebKit.  However, the current specification appears to indicate that the navigation happens synchronously.
> 
> Namely, in the following example, the first alert should be "true" as far as I read the specification.
> 
> <script> var a = false; </script>
> <iframe src="javascript:a=true" onload="a = true"></iframe>
> <script> alert(a); /* or even setTimeout(function(){alert(a);},0); */ setTimeout(function(){alert(a);},10) </script>

I’ll add that Firefox and Internet Explorer both load about:blank asynchronously.

e.g. the first alert in
<script> var a = false; </script>
<iframe src=“about:blink" onload="a = true"></iframe>
<script> alert(a); /* or even setTimeout(function(){alert(a);},0); */ setTimeout(function(){alert(a);},10) </script>
will say “false” in both browsers whereas it says “true” on Safari and Chrome.

- R. Niwa




More information about the whatwg mailing list