| <h1></h1> |
| <script src="random-max-age.cgi"></script> |
| <script> |
| // Random.cgi will include a global "randomNumber". |
| // Always send this back to our opener. |
| opener.postMessage(randomNumber, '*'); |
| |
| // Our opener will tell us to perform various loads. |
| window.addEventListener('message', function(event) { |
| |
| // Go forward and back. |
| if (event.data === 'go-forward-and-back') { |
| window.location = 'history-back.html'; |
| return; |
| } |
| |
| // Reload. |
| if (event.data === 'reload') { |
| window.location.reload(); |
| return; |
| } |
| |
| // Normal navigation, next. |
| if (event.data === 'next') { |
| window.location = 'max-age-resource-next.html'; |
| return; |
| } |
| |
| }, false); |
| </script> |