| <html> | |
| <head> | |
| <title>Preloader</title> | |
| <script src="prerender_events_common.js"></script> | |
| <script> | |
| function UnloadHandler() { | |
| // Signal to the browser the unload happened by hitting a URL. Must | |
| // be synchronous so the request isn't cancelled. | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'http://unload-url.test', false); | |
| xhr.send(); | |
| } | |
| addEventListener('unload', UnloadHandler, false); | |
| </script> | |
| </head> | |
| <body> | |
| <script> | |
| AddPrerender('REPLACE_WITH_PRERENDER_URL', 0); | |
| </script> | |
| </body> | |
| </html> |