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

Unified Diff: chrome/test/data/predictors/javascript_redirect.js

Issue 2609403007: predictors: browser test for client-side redirect. (Closed)
Patch Set: Nits. Created 3 years, 11 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
« no previous file with comments | « chrome/test/data/predictors/javascript_redirect.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/predictors/javascript_redirect.js
diff --git a/chrome/test/data/predictors/javascript_redirect.js b/chrome/test/data/predictors/javascript_redirect.js
new file mode 100644
index 0000000000000000000000000000000000000000..02f2e53180347e062ce01537e4f124e718f194a2
--- /dev/null
+++ b/chrome/test/data/predictors/javascript_redirect.js
@@ -0,0 +1,17 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function getUrlParameters() {
+ var result = {};
+ var parts = window.location.search.substring(1).split('&');
+ for (var i = 0; i < parts.length; i++) {
+ var pair = parts[i].split('=');
+ result[pair[0]] = decodeURIComponent(pair[1]);
+ }
+ return result;
+}
+
+var params = getUrlParameters();
+var redirectUrl = params["url"];
+location.href = redirectUrl;
« no previous file with comments | « chrome/test/data/predictors/javascript_redirect.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698