diff --git a/devtools/client/aboutdebugging-new/src/middleware/debug-target-listener.js b/devtools/client/aboutdebugging-new/src/middleware/debug-target-listener.js index 5c60af652a4b..a0c5c4f4d34c 100644 --- a/devtools/client/aboutdebugging-new/src/middleware/debug-target-listener.js +++ b/devtools/client/aboutdebugging-new/src/middleware/debug-target-listener.js @@ -69,7 +69,7 @@ function debugTargetListenerMiddleware(store) { if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.WORKER)) { client.mainRoot.on("workerListChanged", onWorkersUpdated); - client.addListener("serviceWorkerRegistrationListChanged", onWorkersUpdated); + client.mainRoot.on("serviceWorkerRegistrationListChanged", onWorkersUpdated); client.mainRoot.on("processListChanged", onWorkersUpdated); client.addListener("registration-changed", onWorkersUpdated); client.addListener("push-subscription-modified", onWorkersUpdated); @@ -90,7 +90,7 @@ function debugTargetListenerMiddleware(store) { if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.WORKER)) { client.mainRoot.off("workerListChanged", onWorkersUpdated); - client.removeListener("serviceWorkerRegistrationListChanged", onWorkersUpdated); + client.mainRoot.off("serviceWorkerRegistrationListChanged", onWorkersUpdated); client.mainRoot.off("processListChanged", onWorkersUpdated); client.removeListener("registration-changed", onWorkersUpdated); client.removeListener("push-subscription-modified", onWorkersUpdated); diff --git a/devtools/client/aboutdebugging/components/workers/Panel.js b/devtools/client/aboutdebugging/components/workers/Panel.js index d345964efb8e..9a318038992f 100644 --- a/devtools/client/aboutdebugging/components/workers/Panel.js +++ b/devtools/client/aboutdebugging/components/workers/Panel.js @@ -62,7 +62,7 @@ class WorkersPanel extends Component { client.addListener("workerListChanged", this.updateWorkers); client.mainRoot.on("workerListChanged", this.updateWorkers); - client.addListener("serviceWorkerRegistrationListChanged", this.updateWorkers); + client.mainRoot.on("serviceWorkerRegistrationListChanged", this.updateWorkers); client.mainRoot.on("processListChanged", this.updateWorkers); client.addListener("registration-changed", this.updateWorkers); @@ -88,7 +88,7 @@ class WorkersPanel extends Component { componentWillUnmount() { const client = this.props.client; client.mainRoot.off("processListChanged", this.updateWorkers); - client.removeListener("serviceWorkerRegistrationListChanged", this.updateWorkers); + client.mainRoot.off("serviceWorkerRegistrationListChanged", this.updateWorkers); client.mainRoot.off("workerListChanged", this.updateWorkers); client.removeListener("workerListChanged", this.updateWorkers); client.removeListener("registration-changed", this.updateWorkers); diff --git a/devtools/client/application/initializer.js b/devtools/client/application/initializer.js index d8102c1273cf..a9842e0560fa 100644 --- a/devtools/client/application/initializer.js +++ b/devtools/client/application/initializer.js @@ -44,7 +44,7 @@ window.Application = { }, }; this.toolbox.target.activeTab.on("workerListChanged", this.updateWorkers); - this.client.addListener("serviceWorkerRegistrationListChanged", this.updateWorkers); + this.client.mainRoot.on("serviceWorkerRegistrationListChanged", this.updateWorkers); this.client.addListener("registration-changed", this.updateWorkers); this.client.mainRoot.on("processListChanged", this.updateWorkers); this.toolbox.target.on("navigate", this.updateDomain); @@ -89,7 +89,7 @@ window.Application = { destroy() { this.toolbox.target.activeTab.off("workerListChanged", this.updateWorkers); - this.client.removeListener("serviceWorkerRegistrationListChanged", + this.client.mainRoot.off("serviceWorkerRegistrationListChanged", this.updateWorkers); this.client.removeListener("registration-changed", this.updateWorkers); this.client.mainRoot.off("processListChanged", this.updateWorkers);