title: Preventing iframe top-level redirect
body: <p>I'm trying to prevent a top-level redirect from an iframe. My code works great, but any time a user tries to leave the page, they get asked if they want to stop the script and navigate, or not. This is for a kind of high end website, so I was wondering if there was a way around this dialog box? Here is my current code:</p>
  
  <pre><code>window.onbeforeunload = function(){
      return false;
  }
  </code></pre>
  
  <p>I'm using sandbox="" in my iframe to prevent the dialog box from poping up onload. If anyone knows how to prevent this from happening upon leaving the page and is willing to give me some advice, it'd be greatly appreciated!</p>