-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathshell.html
32 lines (27 loc) · 827 Bytes
/
shell.html
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
32
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="shell.css">
<title>event-loop test</title>
</head>
<body>
<button id="testiframeButton" onclick="startTestInIFrame()" style="font-size:xx-large">Start test in iFrame</button>
<script>
'use strict';
function startTestInIFrame() {
var iframes = document.querySelectorAll('iframe');
for (var i=0; i<iframes.length; i++)
iframes[i].parentNode.removeChild(iframes[i]);
var iframe = document.createElement('iframe');
iframe.setAttribute('src', 'test.html');
iframe.width = '300px';
iframe.height = '300px';
document.body.appendChild(iframe);
window.setTimeout(function(ev) {
iframe.contentWindow.postMessage('startTest', '*');
}, 300);
}
</script>
</body>
</html>