title: Event when iframe starts rendering page contents
body: <p>It is possible to detect when <code>&lt;iframe&gt;</code> leaves a page, provided you have access to that page:</p>
  
  <pre><code>IFRAME.contentWindow.addEventListener("unload", function() {
    parent.console.log("Unloading.");
  });
  </code></pre>
  
  <p>But this requires that </p>
  
  <ul>
  <li>You have access to the inner page (I have, but still...)</li>
  <li>There is some inner window</li>
  <li><p>You wait for the frame to load to assign this event, so the actual code is:</p>
  
  <pre><code>fr.onload = function() {
    this.contentWindow.addEventListener("unload", function() {
      parent.console.log("Unload.");
    });
    console.log("Load");
  }
  </code></pre></li>
  <li><p>... and the onload event takes <em>very very very</em> long on modern pages (due to stupid facebook like plugins and similar stuff).</p></li>
  </ul>
  
  <p>I am making an userscript and the requirement is that I am detect when, within the <code>&lt;iframe&gt;</code> <strong>document starts being loaded</strong>, the moment when javascript is already working in that document. If this is not possible, then at least the event when the webpage has been loaded and is only waiting for asynchronous data (CSS, images, IFRAMEs).</p>