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

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

Issue 2692653003: [Devtools] Added Enable/Disable for request blocking in network (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into ADD_ENABLE_DISABLE_REQ… Created 3 years, 9 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: third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js
index d7b9ae832ddc9a39630308fb20a686c5be5709fa..216eab839503967fa60da64b88da2dbaaacb6bbe 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js
@@ -110,6 +110,28 @@ Network.NetworkPanel = class extends UI.Panel {
this._networkLogView.addEventListener(Network.NetworkLogView.Events.UpdateRequest, this._onUpdateRequest, this);
Components.DataSaverInfobar.maybeShowInPanel(this);
+
+ var blockedURLsSetting = Common.moduleSetting('networkBlockedURLs');
+ blockedURLsSetting.addChangeListener(updateIconVisibility.bind(this));
+ var requestBlockingEnabledSetting = Common.moduleSetting('requestBlockingEnabled');
+ requestBlockingEnabledSetting.addChangeListener(updateIconVisibility.bind(this));
+
+ updateIconVisibility.call(this);
+
+ /**
+ * @this {Network.NetworkPanel}
+ */
+ function updateIconVisibility() {
dgozman 2017/03/20 18:05:47 Note this does not work in case you do throttling
+ var icon = null;
+ if (SDK.multitargetNetworkManager.isThrottling()) {
+ icon = UI.Icon.create('smallicon-warning');
+ icon.title = Common.UIString('Network throttling is enabled');
+ } else if (requestBlockingEnabledSetting.get() && blockedURLsSetting.get().length) {
+ icon = UI.Icon.create('smallicon-warning');
+ icon.title = Common.UIString('Requests may be blocked');
+ }
+ UI.inspectorView.setPanelIcon(this.name, icon);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698