OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <title>Preloader</title> |
| 4 |
| 5 <script> |
| 6 function ExtractGetParameterBadlyAndInsecurely(param, default_value) { |
| 7 var re = RegExp("[&?]" + param + "=([^&?#]*)"); |
| 8 var result = re.exec(document.location); |
| 9 if (result) |
| 10 return result[1]; |
| 11 return default_value; |
| 12 } |
| 13 |
| 14 var links_to_insert = ExtractGetParameterBadlyAndInsecurely( |
| 15 'links_to_insert', 1); |
| 16 var links_to_remove = ExtractGetParameterBadlyAndInsecurely( |
| 17 'links_to_remove', 1); |
| 18 |
| 19 function RemoveLinkElementAndNavigate() { |
| 20 for (var i = 1; i <= links_to_remove; ++i) { |
| 21 var link = document.getElementById("prerender_element_" + i); |
| 22 link.parentElement.removeChild(link); |
| 23 } |
| 24 document.location = "REPLACE_WITH_DESTINATION_URL"; |
| 25 } |
| 26 </script> |
| 27 |
| 28 </head> |
| 29 <body> |
| 30 <script> |
| 31 for (var i = 1; i <= links_to_insert; ++i) { |
| 32 document.write('<link id="prerender_element_' + |
| 33 i + |
| 34 '" rel="prerender" href="REPLACE_WITH_PRERENDER_URL"/>'); |
| 35 } |
| 36 </script> |
| 37 <a href="REPLACE_WITH_DESTINATION_URL">Link To Click</a> |
| 38 </body> |
| 39 </html> |
OLD | NEW |