Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / test / data / prerender / prerender_loader_removing_links.html
blobb114fcce464ceea6b965d5e24173d20e7919bd1d
1 <html>
2 <head>
3 <title>Preloader</title>
5 <script src="prerender_events_common.js"></script>
7 <script>
8 function ExtractGetParameterBadlyAndInsecurely(param, defaultValue) {
9 var re = RegExp('[&?]' + param + '=([^&?#]*)');
10 var result = re.exec(document.location);
11 if (result)
12 return result[1];
13 return defaultValue;
16 var numLinksToInsert =
17 ExtractGetParameterBadlyAndInsecurely('links_to_insert', 1);
19 function RemoveLinkElement(index) {
20 var link = document.getElementById('prerenderElement' + index);
21 link.parentElement.removeChild(link);
23 </script>
24 </head>
25 <body>
26 <script>
27 for (var i = 0; i < numLinksToInsert; ++i) {
28 var link = AddPrerender('REPLACE_WITH_DESTINATION_URL', i);
29 link.id = 'prerenderElement' + i;
31 </script>
32 <a id="toClick" href="REPLACE_WITH_DESTINATION_URL">Link To Click For First Prerender</a>
33 </body>
34 </html>