title: "Unsafe JavaScript attempt to access frame with URL..." with local files
body: <p>I'm trying to access an iframe contents from the document it is contained in, but I'm getting the following error message:</p>
  
  <blockquote>
    <p>Unsafe JavaScript attempt to access frame with URL<br>
    file:///home/user/work/project/foo.html from frame with URL<br>
    file:///home/user/work/project/index.html. Domains, protocols and
    ports must match.</p>
  </blockquote>
  
  <p>when I run this code:</p>
  
  <pre><code>$('#iframe_id').contents();
  </code></pre>
  
  <p>As you can see, both files are stored locally in the same folder, so can't figure out why it is giving that error.</p>