Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In my experience developing with Firefox, I've found in some cases the initialization code for various elements acts as if it were asynchronous. In other words, when you're done executing</p> <pre><code>var newBrowser = window.document.createElement('browser'); newBrowser.setAttribute('flex', '1'); newBrowser.setAttribute('type', 'content'); cacheFrame.insertBefore(newBrowser, null); </code></pre> <p>, your <code>browser</code> may not actually be ready yet. When you add the delay, things have time to initialize, so they work fine. Additionally, when you do things like dynamically creating <code>browser</code> elements, you're likely doing something that very few have tried before. In other words, this sounds like a bug in Firefox, and probably one that will not get much attention.</p> <p>You say you're using <code>onLocationChange</code> so that you can know when to add a <code>load</code> listener. I'm going to guess that you're adding the <code>load</code> listener to the <code>contentDocument</code> since you mentioned it. What you can do instead is add the <code>load</code> listener to the <code>browser</code> itself, much like you would with an <code>iframe</code>. If I replace</p> <pre><code>newBrowser.addProgressListener(listener); </code></pre> <p>with</p> <pre><code>newBrowser.addEventListener("load", function(e) { console.log('got here! ' + e.target.contentDocument.location.href); }, false); </code></pre> <p>then I receive notifications for each <code>browser</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload