Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: chrome/test/data/prerender/prerender_loader_removing_links.html

Issue 9875026: **NOTFORLANDING** New link rel=prerender API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch sets 3-7 against trunk, for combined browsing Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698