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

Side by Side Diff: Source/devtools/front_end/bindings/BlackboxSupport.js

Issue 1315193014: DevTools: allow blackboxing anonymous scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « LayoutTests/inspector/sources/debugger-frameworks/frameworks-blackbox-patterns.html ('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 WebInspector.BlackboxSupport = {} 5 WebInspector.BlackboxSupport = {}
6 6
7 /** 7 /**
8 * @param {string} url 8 * @param {string} url
9 * @return {string} 9 * @return {string}
10 */ 10 */
11 WebInspector.BlackboxSupport._urlToRegExpString = function(url) 11 WebInspector.BlackboxSupport._urlToRegExpString = function(url)
12 { 12 {
13 var parsedURL = new WebInspector.ParsedURL(url); 13 var parsedURL = new WebInspector.ParsedURL(url);
14 if (parsedURL.isAboutBlank() || parsedURL.isDataURL() || !url) 14 if (parsedURL.isAboutBlank() || parsedURL.isDataURL())
15 return ""; 15 return "";
16 if (!parsedURL.isValid) 16 if (!parsedURL.isValid)
17 return "^" + url.escapeForRegExp() + "$"; 17 return "^" + url.escapeForRegExp() + "$";
18 var name = parsedURL.lastPathComponent; 18 var name = parsedURL.lastPathComponent;
19 if (name) 19 if (name)
20 name = "/" + name; 20 name = "/" + name;
21 else if (parsedURL.folderPathComponents) 21 else if (parsedURL.folderPathComponents)
22 name = parsedURL.folderPathComponents + "/"; 22 name = parsedURL.folderPathComponents + "/";
23 if (!name) 23 if (!name)
24 name = parsedURL.host; 24 name = parsedURL.host;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 WebInspector.moduleSetting("skipStackFramesPattern").setAsArray(regexPattern s); 97 WebInspector.moduleSetting("skipStackFramesPattern").setAsArray(regexPattern s);
98 } 98 }
99 99
100 /** 100 /**
101 * @param {string} url 101 * @param {string} url
102 * @return {boolean} 102 * @return {boolean}
103 */ 103 */
104 WebInspector.BlackboxSupport.isBlackboxedURL = function(url) 104 WebInspector.BlackboxSupport.isBlackboxedURL = function(url)
105 { 105 {
106 var regex = WebInspector.moduleSetting("skipStackFramesPattern").asRegExp(); 106 var regex = WebInspector.moduleSetting("skipStackFramesPattern").asRegExp();
107 return (url && regex) ? regex.test(url) : false; 107 return regex && regex.test(url);
108 } 108 }
109 109
110 /** 110 /**
111 * @param {string} url 111 * @param {string} url
112 * @param {boolean} isContentScript 112 * @param {boolean} isContentScript
113 * @return {boolean} 113 * @return {boolean}
114 */ 114 */
115 WebInspector.BlackboxSupport.isBlackboxed = function(url, isContentScript) 115 WebInspector.BlackboxSupport.isBlackboxed = function(url, isContentScript)
116 { 116 {
117 if (isContentScript && WebInspector.moduleSetting("skipContentScripts").get( )) 117 if (isContentScript && WebInspector.moduleSetting("skipContentScripts").get( ))
(...skipping 11 matching lines...) Expand all
129 } 129 }
130 130
131 /** 131 /**
132 * @param {function(!WebInspector.Event)} listener 132 * @param {function(!WebInspector.Event)} listener
133 * @param {!Object=} thisObject 133 * @param {!Object=} thisObject
134 */ 134 */
135 WebInspector.BlackboxSupport.removeChangeListener = function(listener, thisObjec t) 135 WebInspector.BlackboxSupport.removeChangeListener = function(listener, thisObjec t)
136 { 136 {
137 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListener(li stener, thisObject); 137 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListener(li stener, thisObject);
138 } 138 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/sources/debugger-frameworks/frameworks-blackbox-patterns.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698