<script> function loadNext() { window.addEventListener('deviceorientation', function() {}); if (window.opener.reportPageOneOnload() == 1) { window.opener.debug('resources/cached-page-1.html about to navigate to resources/cached-page-2.html') // Location changes need to happen outside the onload handler to generate history entries. setTimeout(function() { location.href = 'cached-page-2.html'; }, 0); } } </script> <body onload="loadNext()"></body>