diff --git a/browser/devtools/netmonitor/netmonitor-controller.js b/browser/devtools/netmonitor/netmonitor-controller.js index 78e3c7fd377..8fd3238d217 100644 --- a/browser/devtools/netmonitor/netmonitor-controller.js +++ b/browser/devtools/netmonitor/netmonitor-controller.js @@ -93,7 +93,8 @@ const ACTIVITY_TYPE = { // Forcing the target to reload with cache enabled or disabled. RELOAD: { WITH_CACHE_ENABLED: 1, - WITH_CACHE_DISABLED: 2 + WITH_CACHE_DISABLED: 2, + WITH_CACHE_DEFAULT: 3 }, // Enabling or disabling the cache without triggering a reload. @@ -355,7 +356,9 @@ let NetMonitorController = { let navigationFinished = waitForNavigation(); return reconfigureTab(aOptions).then(() => navigationFinished); } - + if (aType == ACTIVITY_TYPE.RELOAD.WITH_CACHE_DEFAULT) { + return reconfigureTabAndWaitForNavigation({}).then(standBy); + } if (aType == ACTIVITY_TYPE.RELOAD.WITH_CACHE_ENABLED) { this._currentActivity = ACTIVITY_TYPE.ENABLE_CACHE; this._target.once("will-navigate", () => this._currentActivity = aType); diff --git a/browser/devtools/netmonitor/netmonitor-view.js b/browser/devtools/netmonitor/netmonitor-view.js index 6ec1aeeaf3c..e60aa31a512 100644 --- a/browser/devtools/netmonitor/netmonitor-view.js +++ b/browser/devtools/netmonitor/netmonitor-view.js @@ -229,6 +229,10 @@ let NetMonitorView = { }); }, + reloadPage: function() { + NetMonitorController.triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_DEFAULT); + }, + /** * Lazily initializes and returns a promise for a Editor instance. * @@ -362,6 +366,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { this._onContextCopyImageAsDataUriCommand = this.copyImageAsDataUri.bind(this); this._onContextResendCommand = this.cloneSelectedRequest.bind(this); this._onContextPerfCommand = () => NetMonitorView.toggleFrontendMode(); + this._onReloadCommand = () => NetMonitorView.reloadPage(); this.sendCustomRequestEvent = this.sendCustomRequest.bind(this); this.closeCustomRequestEvent = this.closeCustomRequest.bind(this); @@ -379,6 +384,8 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { }, _onConnect: function() { + $("#requests-menu-reload-notice-button").addEventListener("command", this._onReloadCommand, false); + if (NetMonitorController.supportsCustomRequest) { $("#request-menu-context-resend").addEventListener("command", this._onContextResendCommand, false); $("#custom-request-send-button").addEventListener("click", this.sendCustomRequestEvent, false); @@ -426,6 +433,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, { $("#request-menu-context-resend").removeEventListener("command", this._onContextResendCommand, false); $("#request-menu-context-perf").removeEventListener("command", this._onContextPerfCommand, false); + $("#requests-menu-reload-notice-button").removeEventListener("command", this._onReloadCommand, false); $("#requests-menu-perf-notice-button").removeEventListener("command", this._onContextPerfCommand, false); $("#requests-menu-network-summary-button").removeEventListener("command", this._onContextPerfCommand, false); $("#requests-menu-network-summary-label").removeEventListener("click", this._onContextPerfCommand, false); diff --git a/browser/devtools/netmonitor/netmonitor.xul b/browser/devtools/netmonitor/netmonitor.xul index 4edcd6cbe5c..f6fd780432a 100644 --- a/browser/devtools/netmonitor/netmonitor.xul +++ b/browser/devtools/netmonitor/netmonitor.xul @@ -135,15 +135,19 @@ + +