diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js index 0af98b8a5a43..b77b0d761f82 100644 --- a/devtools/client/framework/toolbox.js +++ b/devtools/client/framework/toolbox.js @@ -3576,11 +3576,11 @@ Toolbox.prototype = { settleAll(outstanding) .catch(console.error) .then(() => { - const api = this._netMonitorAPI; - this._netMonitorAPI = null; - return api ? api.destroy() : null; - }, console.error) - .then(() => { + if (this._netMonitorAPI) { + this._netMonitorAPI.destroy(); + this._netMonitorAPI = null; + } + this._removeWindowListeners(); this._removeChromeEventHandlerEvents(); diff --git a/devtools/client/netmonitor/panel.js b/devtools/client/netmonitor/panel.js index 423f113e2043..494d852d3c4f 100644 --- a/devtools/client/netmonitor/panel.js +++ b/devtools/client/netmonitor/panel.js @@ -29,10 +29,9 @@ NetMonitorPanel.prototype = { return this; }, - async destroy() { - await this.panelWin.Netmonitor.destroy(); + destroy() { + this.panelWin.Netmonitor.destroy(); this.emit("destroyed"); - return this; }, }; diff --git a/devtools/client/netmonitor/src/api.js b/devtools/client/netmonitor/src/api.js index d5d62b146af3..306b1532ecc4 100644 --- a/devtools/client/netmonitor/src/api.js +++ b/devtools/client/netmonitor/src/api.js @@ -80,13 +80,13 @@ NetMonitorAPI.prototype = { /** * Clean up (unmount from DOM, remove listeners, disconnect). */ - async destroy() { + destroy() { this.off(EVENTS.PAYLOAD_READY, this.onPayloadReady); - await this.connector.disconnect(); + this.connector.disconnect(); if (this.harExportConnector) { - await this.harExportConnector.disconnect(); + this.harExportConnector.disconnect(); } }, diff --git a/devtools/client/netmonitor/src/app.js b/devtools/client/netmonitor/src/app.js index 97d2a4d9b610..c2d8eebfb670 100644 --- a/devtools/client/netmonitor/src/app.js +++ b/devtools/client/netmonitor/src/app.js @@ -68,14 +68,14 @@ NetMonitorApp.prototype = { /** * Clean up (unmount from DOM, remove listeners, disconnect). */ - async destroy() { + destroy() { unmountComponentAtNode(this.mount); // Make sure to destroy the API object. It's usually destroyed // in the Toolbox destroy method, but we need it here for case // where the Network panel is initialized without the toolbox // and running in a tab (see initialize.js for details). - await this.api.destroy(); + this.api.destroy(); }, /** diff --git a/devtools/client/netmonitor/src/connector/chrome-connector.js b/devtools/client/netmonitor/src/connector/chrome-connector.js index afa78046b1a9..e2f7e71c2455 100644 --- a/devtools/client/netmonitor/src/connector/chrome-connector.js +++ b/devtools/client/netmonitor/src/connector/chrome-connector.js @@ -37,7 +37,7 @@ class ChromeConnector { this.connector.willNavigate(this.willNavigate); } - async disconnect() { + disconnect() { this.connector.disconnect(); } diff --git a/devtools/client/netmonitor/src/connector/firefox-connector.js b/devtools/client/netmonitor/src/connector/firefox-connector.js index 67102de6eca3..208d67a31940 100644 --- a/devtools/client/netmonitor/src/connector/firefox-connector.js +++ b/devtools/client/netmonitor/src/connector/firefox-connector.js @@ -88,12 +88,12 @@ class FirefoxConnector { } } - async disconnect() { + disconnect() { if (this.actions) { this.actions.batchReset(); } - await this.removeListeners(); + this.removeListeners(); if (this.emulationFront) { this.emulationFront.destroy(); @@ -162,7 +162,7 @@ class FirefoxConnector { await this.webConsoleClient.startListeners(["DocumentEvents"]); } - async removeListeners() { + removeListeners() { if (this.tabTarget) { this.tabTarget.off("close", this.disconnect); if (this.webSocketFront) {