<!doctype html> | |
<html> | |
<head><title>Document</title></head> | |
<body> | |
<h1>Document</h1> | |
<script> | |
window.addEventListener("load", function() { | |
window.addEventListener("visibilitychange", event => { | |
opener.postMessage({ | |
target: event.target.nodeName, | |
state: document.visibilityState, | |
bubbles: event.bubbles | |
}, "*"); | |
}); | |
opener.postMessage("close", "*"); | |
}); | |
</script> | |
</body> | |
</html> |