blob: ff5ce46a5e3136207c9a7289cc4d7a11652c1bd1 [file] [log] [blame]
<html>
<head>
<script>
function didShowPage() {
// Notify opener.
opener.postMessage('first-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 to other page.
if (event.data === 'navigate-other-page') {
window.location = 'other-page.html';
return;
}
}, false);
}
}
</script>
</head>
<body onpageshow="didShowPage();">
</body>
</html>