| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <title>Prerender fragment testing under location.hash change</title> | |
| 4 | |
| 5 <script> | |
| 6 if (window.location.hash === "") { | |
| 7 window.location.hash = "fragment"; | |
| 8 } | |
| 9 | |
| 10 var pageWasPrerendered = false; | |
| 11 | |
| 12 function DidPrerenderPass() { | |
| 13 pageWasPrerendered = true; | |
| 14 return window.location.hash === "#fragment"; | |
| 15 } | |
| 16 | |
| 17 // Make sure DidPrerenderPass() was called first. Otherwise, the page was | |
| 18 // most likely reloaded instead of using the prerendered page. | |
| 19 function DidDisplayPass() { | |
| 20 return pageWasPrerendered && window.location.hash === "#fragment"; | |
| 21 } | |
| 22 | |
| 23 </script> | |
| 24 | |
| 25 </head> | |
| 26 <body> | |
| 27 <a name="fragment">Fragment</a> | |
| 28 </body> | |
| 29 </html> | |
| 30 | |
| OLD | NEW |