blob: a5c75f496bd788c1c6ae389f308d0f2902ef71e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inner document</title>
</head>
<body>
<h1>Inner</h1>
<script>
window.onmessage = function(e) {
if (e.data == "getlog") {
parent.postMessage(log, "*");
}
};
let log = "log:";
window.onfocus = function() {
log += "windowfocus,"
}
window.onblur = function() {
log += "windowblur,"
}
window.onload = function() {
log += "willfocuswindow,"
window.focus();
log += "didfocuswindow,"
parent.postMessage("start", "*");
}
</script>
</body>
</html>
|