title: How to get content page from XUL?
body: <p>i cannot get current content page html. when i trying access from script in xul element. not current open url.</p>
  
  <p>i use this code:</p>
  
  <pre class="lang-js prettyprint-override"><code>alert(document.getElementById("html"));
  </code></pre>
  
  <p>it will alert <strong>null</strong> value, document return XUL object, not Html object. 
  I want parsing current content page, but i dont know how to do it.</p>
  
  <pre class="lang-js prettyprint-override"><code>var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                 .getInterface(Components.interfaces.nsIWebNavigation)
                 .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
                 .rootTreeItem
                 .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                 .getInterface(Components.interfaces.nsIDOMWindow);
  
      alert(mainWindow.getBrowser().selectedBrowser.contentWindow.location.href);
      alert(mainWindow.getBrowser().selectedBrowser.contentWindow.document);
  </code></pre>
  
  <p>when i use this code, no alert shown. </p>