summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/page-visibility/resources/unload.html
blob: b548518784174e216856f93503c5d6bf06f3687a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!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>