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

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

Issue 2179623002: Merge to 2743 "[DevTools] Whitelist remoteFrontendUrl and remoteBase params." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/Source/devtools/front_end/Runtime.js ('k') | 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 1e8c833e8a0ae576bb846e5f67470e8741ef818c..8733ac56cbc029c524cfe7717a346c1c7d046389 100644
--- a/third_party/WebKit/Source/devtools/front_end/devtools.js
+++ b/third_party/WebKit/Source/devtools/front_end/devtools.js
@@ -984,6 +984,8 @@ function installObjectObserve()
*/
function sanitizeRemoteFrontendUrl()
{
+ var remoteBaseRegexp = /^https:\/\/chrome-devtools-frontend\.appspot\.com\/serve_file\/@[0-9a-zA-Z]+\/?$/;
+ var remoteFrontendUrlRegexp = /^https:\/\/chrome-devtools-frontend\.appspot\.com\/serve_rev\/@?[0-9a-zA-Z]+\/(devtools|inspector)\.html$/;
var queryParams = location.search;
if (!queryParams)
return;
@@ -992,7 +994,9 @@ function sanitizeRemoteFrontendUrl()
var pair = params[i].split("=");
var name = pair.shift();
var value = pair.join("=");
- if (name === "remoteFrontendUrl" && !value.startsWith("https://chrome-devtools-frontend.appspot.com/"))
+ if (name === "remoteFrontendUrl" && !remoteFrontendUrlRegexp.test(value))
+ location.search = "";
+ if (name === "remoteBase" && !remoteBaseRegexp.test(value))
location.search = "";
}
}
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/Runtime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698