title: Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match
body: <p>I set an iframe on my page and use below script to remove the double navigation bars. It works well on any browser, but doesn't work on Chrome, it shows double vertical navigation bars!</p>
  
  <pre><code>function calcHeight() {
      //find the height of the internal page
      var the_height = document.getElementById('the_iframe').contentWindow.
                       document.body.scrollHeight;
  
      //change the height of the iframe
      document.getElementById('the_iframe').height = (the_height + 30) +"px";
  }
  </code></pre>
  
  <p>I get 2 errors messages in Chrome:</p>
  
  <ul>
  <li><p>First error message:</p>
  
  <blockquote>
    <p>Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. </p>
  </blockquote>
  
  <p>and it points out the error at:  </p>
  
  <pre><code>var the_height = document.getElementById('the_iframe').contentWindow.
                   document.body.scrollHeight;
  </code></pre></li>
  <li><p>Second error message, it is located in jquery-1.10.2.js:</p>
  
  <blockquote>
    <p>Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. </p>
  </blockquote>
  
  <p>It points out the error message at:</p>
  
  <pre><code>elem.contentDocument || elem.contentWindow.document : 
  </code></pre></li>
  </ul>