4 var pageWasPrerendered
= false;
6 // Make sure plugin was not loaded while prerendering.
7 function DidPrerenderPass() {
8 pageWasPrerendered
= true;
12 // Make sure DidPrerenderPass() was called first. Otherwise, the page was
13 // most likely reloaded instead of using the prerendered page.
14 function DidDisplayPass() {
15 return pageWasPrerendered
;
19 var xhr
= new XMLHttpRequest();
20 xhr
.onreadystatechange = function() {
21 if(xhr
.readyState
== 4) {
22 if(xhr
.status
== 200) {
23 document
.getElementById("dynamic").innerHTML
=
24 "Received:" + xhr
.responseText
;
26 document
.getElementById("dynamic").innerHTML
=
27 "Error code: " + xhr
.status
;
32 xhr
.open("DELETE", "non-existant-file", true);
36 // Fire the XHR after onload so to consistently abort after
37 // webkitprerenderload, rather than racily abort on one side or the
39 window
.onload
= setTimeout
.bind(null, do_xhr
);
44 Waiting for XHR response.