34 lines
918 B
HTML
34 lines
918 B
HTML
<html>
|
|
<head>
|
|
<script>
|
|
function didShowPage() {
|
|
// Notify opener.
|
|
opener.postMessage('other-page', '*');
|
|
|
|
// We register the listeners in the initial load (this is not needed
|
|
// when the page is restored from cache).
|
|
if (!event.persisted) {
|
|
// Our opener will tell us to perform various loads.
|
|
window.addEventListener('message', function(event) {
|
|
|
|
// Navigate first resource.
|
|
if (event.data === 'navigate-first-page') {
|
|
window.location = 'first-page.html';
|
|
return;
|
|
}
|
|
|
|
// Navigate back.
|
|
if (event.data === 'navigate-back') {
|
|
window.history.back();
|
|
return;
|
|
}
|
|
|
|
}, false);
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onpageshow="didShowPage();">
|
|
</body>
|
|
</html>
|