-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprerender-inner.html
39 lines (32 loc) · 1.04 KB
/
prerender-inner.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
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
</head>
<body>
<iframe src="openers.html"></iframe>
<iframe src="https://chivalrous-aerial-riverbed.glitch.me/navigate-to-about-blank.html"></iframe>
<div id="console">
<div class="entry">Events:</div>
</div>
</body>
<script>
const elemConsole = document.getElementById('console');
function log(s) {
const time = new Date().toLocaleTimeString();
const str = `[${time}] ${s}`;
const entry = elemConsole.firstElementChild.cloneNode();
entry.innerText = str;
elemConsole.appendChild(entry);
}
window.addEventListener('load', () => {
log(`Load Event - document.prerendering[${document.prerendering}]`);
});
document.addEventListener('prerenderingchange', () => {
log(`Prerendering change - document.prerendering[${document.prerendering}]`);
});
window.setInterval(() => {
log(`Tick - document.prerendering[${document.prerendering}]`);
}, 1000);
</script>
</html>