title: Detect Image Page Load on Firefox
body: <p>I can detect web page DOMContentLoaded event by assigning below event listener to gBrowser.</p>
  
  <pre><code>if (event.originalTarget instanceof HTMLDocument) {
      var doc = event.originalTarget;
      if (event.originalTarget.defaultView.frameElement) {
          while (doc.defaultView.frameElement) {
              return;
          }
      } 
  }       
  </code></pre>
  
  <p>But above code does not detect chrome pages which are used to wrap images.  Example:</p>
  
  <p><a href="https://addons.cdn.mozilla.net/media/img/app-icons/med/firefox.png" rel="nofollow">https://addons.cdn.mozilla.net/media/img/app-icons/med/firefox.png</a></p>
  
  <p>How can the document which is loading images be detected for Firefox?   </p>