| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <title>Preloader</title> |
| 4 <script src="prerender_events_common.js"></script> |
| 5 |
| 6 <script> |
| 7 function BeforeUnloadHandler() { |
| 8 // Notify with XHR the RequestCounter that the handler has been executed. |
| 9 // The request must be async in order to be allowed in a beforeunload |
| 10 // handler. |
| 11 var xhr = new XMLHttpRequest(); |
| 12 xhr.open('GET', 'http://unload-url.test', true); |
| 13 xhr.send(); |
| 14 } |
| 15 |
| 16 addEventListener('beforeunload', BeforeUnloadHandler, false); |
| 17 </script> |
| 18 |
| 19 </head> |
| 20 <body> |
| 21 <script> |
| 22 AddPrerender('REPLACE_WITH_PRERENDER_URL', 0); |
| 23 </script> |
| 24 </body> |
| 25 </html> |
| OLD | NEW |