Hacker News new | ask | show | jobs
by dujiulun2006 4100 days ago
Since GitHub (and other sites) can modify their webpages, something like:

<script>

if (window != top) top.location = 'http://www.google.com';

</script>

returned as a static webpage would do the trick.

1 comments

This script can be disabled with the sandbox attribute on <iframe>: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if...
Scorch the earth if it doesn't work then:

    <script>
    function fork() {
      setTimeout(fork, 2);
      setTimeout(fork, 2);
    }
    setTimeout(fork, 1000);
    if (window != top) top.location = 'http://www.google.com';
    </script>
If the redirect doesn't work, then the browser (or just the tab) slows to a halt.
Too late, they should have done that first. Nice idea though.
In that case maybe the other solution is better. Wow HTML5 is crazy...