title: Javascript Iframe Security Error Within Try/Catch Block In Webkit Browsers
body: <p>When I run the following code in webkit browsers, I get an error outputted to the console despite having my code wrapped in a try/catch block. </p>
  
  <pre><code>var externallyFramed = false;
  try {
    externallyFramed = top.location.host != location.host;
  } catch (e) {
    externallyFramed = true;
  }
  </code></pre>
  
  <p>The error I get is the following:</p>
  
  <p><strong>Unsafe JavaScript attempt to access frame with URL...</strong></p>
  
  <p>Is there anything I can do differently to prevent the error from showing up?</p>