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

Unified Diff: third_party/WebKit/Source/devtools/front_end/devtools.js

Issue 2010783002: Merge to 2704 "[DevTools] Sanitize remoteFrontendUrl for old frontends." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/devtools.js
diff --git a/third_party/WebKit/Source/devtools/front_end/devtools.js b/third_party/WebKit/Source/devtools/front_end/devtools.js
index dcbcd758dbdd774c2a3766b16ca9eb30344869a0..f9c05b2c74478b1c71c0139a5673d6f89bfff5f5 100644
--- a/third_party/WebKit/Source/devtools/front_end/devtools.js
+++ b/third_party/WebKit/Source/devtools/front_end/devtools.js
@@ -964,8 +964,28 @@ function installObjectObserve()
/**
* @suppressGlobalPropertiesCheck
*/
+function sanitizeRemoteFrontendUrl()
+{
+ var queryParams = location.search;
+ if (!queryParams)
+ return;
+ var params = queryParams.substring(1).split("&");
+ for (var i = 0; i < params.length; ++i) {
+ var pair = params[i].split("=");
+ var name = pair.shift();
+ var value = pair.join("=");
+ if (name === "remoteFrontendUrl" && !value.startsWith("https://chrome-devtools-frontend.appspot.com/"))
+ location.search = "";
+ }
+}
+
+/**
+ * @suppressGlobalPropertiesCheck
+ */
function installBackwardsCompatibility()
{
+ sanitizeRemoteFrontendUrl();
+
if (window.location.search.indexOf("remoteFrontend") === -1)
return;
@@ -1021,6 +1041,7 @@ function windowLoaded()
installBackwardsCompatibility();
}
+sanitizeRemoteFrontendUrl();
if (window.document.head && (window.document.readyState === "complete" || window.document.readyState === "interactive"))
installBackwardsCompatibility();
else
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698