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

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

Issue 2609403007: predictors: browser test for client-side redirect. (Closed)
Patch Set: 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
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..05c30685764b98b55f935f41f1342cf6d32c4308
--- /dev/null
+++ b/chrome/test/data/predictors/javascript_redirect.js
@@ -0,0 +1,17 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
Benoit L 2017/01/09 14:31:47 nit: 2017 is the new 2016.
alexilin 2017/01/09 15:08:16 Happy New Year!
+// 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;

Powered by Google App Engine
This is Rietveld 408576698