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

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 'BLOCK_REQUEST_REMOVE_CONTEXT_MENU' into ADD_ENABLE_DISABLE_REQUEST_BLOCKINg Created 3 years, 10 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 e3eda70ec4c1382bcd4dd31871f89dbe12c32063..3f01c504e0b6ce40d17a7ceaa04ca9ed359a208c 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js
@@ -107,6 +107,24 @@ Network.NetworkPanel = class extends UI.Panel {
this._networkLogView.addEventListener(Network.NetworkLogView.Events.UpdateRequest, this._onUpdateRequest, this);
Components.DataSaverInfobar.maybeShowInPanel(this);
+
+ var manager = SDK.multitargetNetworkManager;
+ manager.on(SDK.MultitargetNetworkManager.RequestBlockingEnabledChangedEvent, updateVisibility);
+ manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChanged, updateVisibility);
+ var blockedURLsSetting = Common.moduleSetting('networkBlockedURLs');
+ blockedURLsSetting.addChangeListener(updateVisibility);
+
+ function updateVisibility() {
+ var icon = null;
+ if (manager.isThrottling()) {
+ icon = UI.Icon.create('smallicon-warning');
+ icon.title = Common.UIString('Network throttling is enabled');
+ } else if (SDK.multitargetNetworkManager.isRequestBlockingEnabled() && blockedURLsSetting.get().length) {
pfeldman 2017/02/13 18:24:26 You don't need to check the blocked url length. se
allada 2017/02/16 21:42:02 I thought it'd be better to allow the user to keep
+ icon = UI.Icon.create('smallicon-warning');
+ icon.title = Common.UIString('Requests may be blocked');
+ }
+ UI.inspectorView.setPanelIcon('network', icon);
pfeldman 2017/02/13 18:24:26 this.name
allada 2017/02/16 21:42:03 Done.
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698