| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 onunload = function() { | 2 onunload = function() { |
| 3 // disable page cache | 3 // disable page cache |
| 4 } | 4 } |
| 5 | 5 |
| 6 var pageLoaded = false; | |
| 7 | |
| 8 onpopstate = function() { | 6 onpopstate = function() { |
| 9 // The first time popstate fires, it's because the page has finished loading. | |
| 10 if (!pageLoaded) { | |
| 11 pageLoaded = true; | |
| 12 return; | |
| 13 } | |
| 14 | |
| 15 var topWin = top; | 7 var topWin = top; |
| 16 // Verify that we are still in an iframe | 8 // Verify that we are still in an iframe |
| 17 if (topWin == window) { | 9 if (topWin == window) { |
| 18 topWin.document.body.innerHTML = "FAIL"; | 10 topWin.document.body.innerHTML = "FAIL"; |
| 19 } else { | 11 } else { |
| 20 topWin.document.body.innerHTML = "PASS"; | 12 topWin.document.body.innerHTML = "PASS"; |
| 21 } | 13 } |
| 22 if (topWin.testRunner) | 14 if (topWin.testRunner) |
| 23 topWin.testRunner.notifyDone(); | 15 topWin.testRunner.notifyDone(); |
| 24 } | 16 } |
| 25 | 17 |
| 26 onload = function() { | 18 onload = function() { |
| 27 history.pushState(null, null); | 19 history.pushState(null, null); |
| 28 history.pushState(null, null); | 20 history.pushState(null, null); |
| 29 setTimeout(function() { history.back() }, 0); | 21 setTimeout(function() { history.back() }, 0); |
| 30 } | 22 } |
| 31 </script> | 23 </script> |
| OLD | NEW |