jeudi 5 octobre 2017

Did I break Chrome?

Playing around I found you can open a new tab from within the window.onunload event. It seems this lets me create a page which cannot be closed which I would think Chrome would have some way to prevent but this seems to work.

Try saving the following as index.html and serving it up on localhost:8000 (i.e. using python -m SimpleHTTPServer):

<script>
    window.onunload = function() {
        window.open("http://localhost:8000", "_blank");        
    };
</script>

It seems you cannot get rid of the page. Am I missing something? This seems like it would be bad if used with malicious intent.

I have only tested this in Chrome.

Aucun commentaire:

Enregistrer un commentaire