title: Body is undefined
body: <p>I have the following code in javascript (firefox extension)</p>
  
  <pre><code>var body;
  
  var Test = {
  initializeBody: function(e) {
    if (!e.originalTarget.defaultView.frameElement) {
      body = e.target.ownerDocument.getElementsByTagName('body')[0].cloneNode(true);
    }
  }
  }
  
  window.addEventListener("DOMContentLoaded", function(e) { Test.initializeBody(e); }, false);
  </code></pre>
  
  <p>when I want to use <code>body</code> variable in another function <code>Error console</code> writes that <code>body is undefined</code> . I understand that not all firefox pages have <code>body</code> tag defined, but it writes this message even if I load <a href="http://www.google.com" rel="nofollow">http://www.google.com</a></p>
  
  <p>Do you know what is wrong?</p>
  
  <p>thank you</p>