title: document.body is null when using from a content script in my Chrome Extension
body: <p>I'm observing an interesting behavior that I don't fully understand. I'm injecting the <code>content script</code> for my Chrome Extension into every page that is loaded in the Chrome web browser. The <code>manifest.json</code> filter for that is set up as such:</p>
  
  <pre><code>"content_scripts": [
      {
          "run_at": "document_end",
          "all_frames" : true,
          "match_about_blank": true,
          "matches": ["http://*/*", "https://*/*"],
          "js": ["content.js"]
      }
  ],
  </code></pre>
  
  <p>I then attempt to add <code>onClick</code> global event to the whole loaded document from my <code>content.js</code>:</p>
  
  <pre><code>document.body.addEventListener('click', onClickOnPage, true);
  
  function onClickOnPage(evnt)
  {
      //process global onClick on the page
  }
  </code></pre>
  
  <p>The method above seems to work, except in some rare occasions I get the following exception:</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'addEventListener' of null</p>
  </blockquote>
  
  <p>What is causing it?</p>