1 2 3 4
<!doctype html> <script> addEventListener("beforeunload", function() {parent.parent.beforeunload_fired=true}, false) </script>