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

Side by Side 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, 4 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(window) { 5 (function(window) {
6 6
7 // DevToolsAPI ---------------------------------------------------------------- 7 // DevToolsAPI ----------------------------------------------------------------
8 8
9 /** 9 /**
10 * @constructor 10 * @constructor
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 } 977 }
978 978
979 window.Object.observe = objectObserve; 979 window.Object.observe = objectObserve;
980 } 980 }
981 981
982 /** 982 /**
983 * @suppressGlobalPropertiesCheck 983 * @suppressGlobalPropertiesCheck
984 */ 984 */
985 function sanitizeRemoteFrontendUrl() 985 function sanitizeRemoteFrontendUrl()
986 { 986 {
987 var remoteBaseRegexp = /^https:\/\/chrome-devtools-frontend\.appspot\.com\/s erve_file\/@[0-9a-zA-Z]+\/?$/;
988 var remoteFrontendUrlRegexp = /^https:\/\/chrome-devtools-frontend\.appspot\ .com\/serve_rev\/@?[0-9a-zA-Z]+\/(devtools|inspector)\.html$/;
987 var queryParams = location.search; 989 var queryParams = location.search;
988 if (!queryParams) 990 if (!queryParams)
989 return; 991 return;
990 var params = queryParams.substring(1).split("&"); 992 var params = queryParams.substring(1).split("&");
991 for (var i = 0; i < params.length; ++i) { 993 for (var i = 0; i < params.length; ++i) {
992 var pair = params[i].split("="); 994 var pair = params[i].split("=");
993 var name = pair.shift(); 995 var name = pair.shift();
994 var value = pair.join("="); 996 var value = pair.join("=");
995 if (name === "remoteFrontendUrl" && !value.startsWith("https://chrome-de vtools-frontend.appspot.com/")) 997 if (name === "remoteFrontendUrl" && !remoteFrontendUrlRegexp.test(value) )
998 location.search = "";
999 if (name === "remoteBase" && !remoteBaseRegexp.test(value))
996 location.search = ""; 1000 location.search = "";
997 } 1001 }
998 } 1002 }
999 1003
1000 /** 1004 /**
1001 * @suppressGlobalPropertiesCheck 1005 * @suppressGlobalPropertiesCheck
1002 */ 1006 */
1003 function installBackwardsCompatibility() 1007 function installBackwardsCompatibility()
1004 { 1008 {
1005 sanitizeRemoteFrontendUrl(); 1009 sanitizeRemoteFrontendUrl();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 1073
1070 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { 1074 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) {
1071 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype .toggle; 1075 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype .toggle;
1072 DOMTokenList.prototype.toggle = function(token, force) 1076 DOMTokenList.prototype.toggle = function(token, force)
1073 { 1077 {
1074 if (arguments.length === 1) 1078 if (arguments.length === 1)
1075 force = !this.contains(token); 1079 force = !this.contains(token);
1076 return this.__originalDOMTokenListToggle(token, !!force); 1080 return this.__originalDOMTokenListToggle(token, !!force);
1077 } 1081 }
1078 } 1082 }
OLDNEW
« 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