Revision 40dc6ae8bbd4d1ce358402dd518c8ec26439913b authored by Timothy Gu on 31 July 2018, 19:10:11 UTC, committed by Timothy Gu on 31 July 2018, 19:10:11 UTC
1 parent 5f82b15
Raw File
unload-1.html
<!doctype html>
<html>
<head><title>Document</title></head>
<body>
<h1>Document</h1>
<script>
onload = function() {
  document.addEventListener("visibilitychange", onVisibilityChange, false);
  opener.postMessage("close", "*");
}

function onVisibilityChange() {
  opener.postMessage(document.visibilityState, "*");
}
</script>
</body>
</html>
back to top