title: Prevent JavaScript in parent.window.opener.location
body: <p>I'm trying to prevent page closing when clicking on a external link used this JavaScript code.
  code is running in that other page.</p>
  
  <pre><code>if(parent.window.opener) parent.window.opener.location='//www.domain.com';
  </code></pre>
  
  <p>I have a lot of links, difficult removed or use window.onbeforeunload annoying.</p>
  
  <p>Is there any code do this?</p>
  
  <p>Thanks.</p>