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

Unified Diff: Source/devtools/front_end/sources/CallStackSidebarPane.js

Issue 548323002: DevTools: Blackbox content scripts - frontend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added a test Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/sources/CallStackSidebarPane.js
diff --git a/Source/devtools/front_end/sources/CallStackSidebarPane.js b/Source/devtools/front_end/sources/CallStackSidebarPane.js
index ef64ffa5662b4a9fed0027266c533879f5e357a9..fd41dd3e84e65a236a33f1e6ed2f5cda6d7accd6 100644
--- a/Source/devtools/front_end/sources/CallStackSidebarPane.js
+++ b/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -114,7 +114,7 @@ WebInspector.CallStackSidebarPane.prototype = {
this.placards.push(placard);
this.bodyElement.appendChild(placard.element);
- if (WebInspector.BlackboxSupport.isBlackboxedURL(callFrame.script.sourceURL)) {
+ if (WebInspector.BlackboxSupport.isBlackboxed(callFrame.script.sourceURL, callFrame.script.isContentScript())) {
placard.setHidden(true);
placard.element.classList.add("dimmed");
++this._hiddenPlacards;
@@ -159,7 +159,7 @@ WebInspector.CallStackSidebarPane.prototype = {
var script = placard._callFrame.script;
if (!script.isSnippet()) {
contextMenu.appendSeparator();
- this.appendBlackboxURLContextMenuItems(contextMenu, script.sourceURL);
+ this.appendBlackboxURLContextMenuItems(contextMenu, script.sourceURL, script.isContentScript());
}
contextMenu.show();
@@ -183,28 +183,36 @@ WebInspector.CallStackSidebarPane.prototype = {
/**
* @param {!WebInspector.ContextMenu} contextMenu
* @param {string} url
+ * @param {boolean} isContentScript
*/
- appendBlackboxURLContextMenuItems: function(contextMenu, url)
+ appendBlackboxURLContextMenuItems: function(contextMenu, url, isContentScript)
{
- if (!url)
- return;
- var blackboxed = WebInspector.BlackboxSupport.isBlackboxedURL(url);
- if (blackboxed)
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Stop blackboxing" : "Stop Blackboxing"), this._handleContextMenuBlackboxURL.bind(this, url, false));
- else
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Blackbox script" : "Blackbox Script"), this._handleContextMenuBlackboxURL.bind(this, url, true));
+ var blackboxed = WebInspector.BlackboxSupport.isBlackboxed(url, isContentScript);
+ if (blackboxed) {
+ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Stop blackboxing" : "Stop Blackboxing"), this._handleContextMenuBlackboxURL.bind(this, url, isContentScript, false));
+ } else {
+ if (WebInspector.BlackboxSupport.canBlackboxURL(url))
+ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Blackbox script" : "Blackbox Script"), this._handleContextMenuBlackboxURL.bind(this, url, false, true));
+ if (isContentScript)
+ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Blackbox all content scripts" : "Blackbox All Content Scripts"), this._handleContextMenuBlackboxURL.bind(this, url, true, true));
+ }
},
/**
* @param {string} url
+ * @param {boolean} isContentScript
* @param {boolean} blackbox
*/
- _handleContextMenuBlackboxURL: function(url, blackbox)
+ _handleContextMenuBlackboxURL: function(url, isContentScript, blackbox)
{
- if (blackbox)
- WebInspector.BlackboxSupport.blackboxURL(url);
- else
- WebInspector.BlackboxSupport.unblackboxURL(url);
+ if (blackbox) {
+ if (isContentScript)
+ WebInspector.settings.skipContentScripts.set(true);
+ else
+ WebInspector.BlackboxSupport.blackboxURL(url);
+ } else {
+ WebInspector.BlackboxSupport.unblackbox(url, isContentScript);
+ }
},
_blackboxingStateChanged: function()
« no previous file with comments | « Source/devtools/front_end/settings/SettingsScreen.js ('k') | Source/devtools/front_end/sources/JavaScriptSourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698