
Show HN: A chrome bug makes it hard to leave page - mkoryak
http://www.dogself.com/
======
mkoryak
and this is how it is done:

    
    
                    window.onbeforeunload = function () {
                        var cat = document.createElement('a');
                        cat.setAttribute('href', 'http://ultragen.org');
                        cat.setAttribute('download', 'endless-cats.gif');
                        setTimeout(function () {
                            window.open(document.location.href.replace(document.location.hash, '') + '#' + Math.random(), '_self');
                        }, 0);
                        cat.click();
                        return "cat";
                    };

