Steps to reproduce:
1. Create html file with content.
<html>
<head></head>
<body>
<script>
var func = function(){
return 'xxx';
};
window.onbeforeunload = func;
</script>
</body>
</html>
2. Open it in IE.
3. Click "Allow blocked content".
4. Open 2nd tab.
5. Try close 1st, but click "stay on this page".
6. Close 2nd tab.
7. Try close 1st tab or IE. It is imposible.