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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/prerender/prerender_loader_removing_links.html
diff --git a/chrome/test/data/prerender/prerender_loader_removing_links.html b/chrome/test/data/prerender/prerender_loader_removing_links.html
new file mode 100644
index 0000000000000000000000000000000000000000..8c9581dc1dd89986d794d373e91826cc78f05cfb
--- /dev/null
+++ b/chrome/test/data/prerender/prerender_loader_removing_links.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<title>Preloader</title>
+
+<script>
+function ExtractGetParameterBadlyAndInsecurely(param, default_value) {
+ var re = RegExp("[&?]" + param + "=([^&?#]*)");
+ var result = re.exec(document.location);
+ if (result)
+ return result[1];
+ return default_value;
+}
+
+var links_to_insert = ExtractGetParameterBadlyAndInsecurely(
+ 'links_to_insert', 1);
+var links_to_remove = ExtractGetParameterBadlyAndInsecurely(
+ 'links_to_remove', 1);
+
+function RemoveLinkElementAndNavigate() {
+ for (var i = 1; i <= links_to_remove; ++i) {
+ var link = document.getElementById("prerender_element_" + i);
+ link.parentElement.removeChild(link);
+ }
+ document.location = "REPLACE_WITH_DESTINATION_URL";
+}
+</script>
+
+</head>
+<body>
+<script>
+ for (var i = 1; i <= links_to_insert; ++i) {
+ document.write('<link id="prerender_element_' +
+ i +
+ '" rel="prerender" href="REPLACE_WITH_PRERENDER_URL"/>');
+ }
+</script>
+<a href="REPLACE_WITH_DESTINATION_URL">Link To Click</a>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698