title: Firefox onLocationChange not always called
body: <p>I am building a firefox extension that creates several hidden browser elements.</p>
  
  <p>I would like to <code>addProgressListener()</code> to handle onLocationChange for the page that I load. However, my handler does not always get called.</p>
  
  <p>More specifically, here's what I'm doing:</p>
  
  <ol>
  <li>Create a browser element, without setting its <code>src</code> property</li>
  <li>Attach it to another element</li>
  <li>Add a progress listener listening for <code>onLocationChange</code> to the browser element</li>
  <li>Call <code>loadURIWithFlags()</code> with the desired url and post data</li>
  </ol>
  
  <p>I expect the handler to be called every time after 4, but sometimes it does not (it seems to get stuck on the same pages though).</p>
  
  <p>Interestingly, if I wrap 3 and 4 inside a <code>setTimeout(..., 5000);</code> it works every time.</p>
  
  <p>I've also tried shuffling some of the steps around, but it did not have any effect.</p>
  
  <p>The bigger picture: I would like to be reliably notified when browser's <code>contentDocument</code> is that of the newly loaded page (after redirects). Is there a better way to do this?</p>
  
  <p><strong>Update</strong>: I've since opened a bug on mozilla's bug tracker with a minimal xulrunner app displaying this behavior, in case anybody wants to take a closer look: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=941414">https://bugzilla.mozilla.org/show_bug.cgi?id=941414</a></p>