title: changing iframe url changes parent window url Blocked a frame with origin
body: <p>I use this code</p>
  
  <pre><code>&lt;script&gt;
    &lt;!-- Hide Script
      if (top.location != self.location) {
       top.location = self.location
      }
    //End Hide Script --&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>However recently I get such errors in the chrome console and the code stopped working</p>
  
  <blockquote>
    <p>(index):15 Unsafe JavaScript attempt to initiate navigation for frame with origin '<a href="http://preview.themeforest.net" rel="noreferrer">http://preview.themeforest.net</a>' from frame with URL '<a href="http://site.test" rel="noreferrer">http://site.test</a>'. The frame attempting navigation is targeting its top-level window, but is neither same-origin with its target nor has it received a user gesture. See <a href="https://www.chromestatus.com/features/5851021045661696" rel="noreferrer">https://www.chromestatus.com/features/5851021045661696</a>.</p>
    
    <p>(index):21 Uncaught DOMException: Failed to execute 'replace' on 'Location': The current window does not have permission to navigate the target frame to '<a href="http://site.test" rel="noreferrer">http://site.test</a>''.</p>
  </blockquote>
  
  <p>In Firefox and Opera this code works. In Chrome it does not work.</p>
  
  <p>How to fix these errors?</p>
  
  <p>It's a bit like <a href="https://stackoverflow.com/questions/8573735/changing-iframe-url-changes-parent-window-url">this question</a></p>