Hi all,

Specifically what Rudy encountered is a problem with iframe: there is
no specific event for a moment where
- the content is loaded (and it's window object exists and accessible
from iframe.contentWindow) so we could call
window.addEventListener('load') on the right window object.
- but before it's window.onload took place so that listener could actually fire.

Note that if you tried to get |iframe.contentWindow| as right at the
time you set iframe.src, you'll get the window object of |about:blank|
page.

We thought the special mozbrowserloadstart event from mozbrowser API
can be used, but it's not the case.
I suspect it actually depend on the size of the page loaded; just like
normal browsers, if you click on a link when using a slow network, the
spinner will start spinning ("loadstart") long before you switch to
the destination page. However, how the recent change trigger this
problem remain a mystery, as we didn't really increase the size of
system/index.html significantly.



On Tue, Aug 27, 2013 at 6:03 PM, Rudy Lu <[email protected]> wrote:
> Hi all,
>
> When tracking the following issue,
> *Bug 909124* <https://bugzilla.mozilla.org/show_bug.cgi?id=909124> - [b2g
> desktop] shell.js did not get correct mozbrowserloadstart event to send
> Gaia the pending chromeEvents
>
> I found that shell.js may not get the correct mozbrowserloadstart event for
> the loading of Gaia system app, if running Gaia in b2g desktop.
>
> From my test, most of the time, shell.js would receive 2 times of
> mozbrowserloadstart event, but document.location would still be
> "about:blank".
> This would make shell.js fail to do the correct initialization for Gaia.
>
> So, I was wondering what is the correct behavior for mozbrowserloadstart
> about its timing and when it occurs, if the document.location would have
> been changed or not?
>
> Thanks.
>
> --
> Rudy, Mozilla Taiwan
> _______________________________________________
> dev-gaia mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-gaia



-- 
Tim Guan-tin Chien, Engineering Manager and Front-end Lead, Firefox
OS, Mozilla Corp. (Taiwan)
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to