diff --git a/devtools/client/debugger/panel.js b/devtools/client/debugger/panel.js index e9c2634baa0b..24da5a1aef3a 100644 --- a/devtools/client/debugger/panel.js +++ b/devtools/client/debugger/panel.js @@ -77,12 +77,6 @@ class DebuggerPanel { registerStoreObserver(this._store, this._onDebuggerStateChange.bind(this)); - const resourceWatcher = this.toolbox.resourceWatcher; - await resourceWatcher.watchResources( - [resourceWatcher.TYPES.ERROR_MESSAGE], - { onAvailable: actions.addExceptionFromResources } - ); - return this; } @@ -273,11 +267,6 @@ class DebuggerPanel { } destroy() { - const resourceWatcher = this.toolbox.resourceWatcher; - resourceWatcher.unwatchResources([resourceWatcher.TYPES.ERROR_MESSAGE], { - onAvailable: this._actions.addExceptionFromResources, - }); - this.panelWin.Debugger.destroy(); this.emit("destroyed"); } diff --git a/devtools/client/debugger/src/client/firefox.js b/devtools/client/debugger/src/client/firefox.js index ce05aacac009..37f246d172c1 100644 --- a/devtools/client/debugger/src/client/firefox.js +++ b/devtools/client/debugger/src/client/firefox.js @@ -57,6 +57,9 @@ export async function onConnect( await resourceWatcher.watchResources([resourceWatcher.TYPES.THREAD_STATE], { onAvailable: onBreakpointAvailable, }); + await resourceWatcher.watchResources([resourceWatcher.TYPES.ERROR_MESSAGE], { + onAvailable: actions.addExceptionFromResources, + }); } export function onDisconnect() { @@ -71,6 +74,9 @@ export function onDisconnect() { resourceWatcher.unwatchResources([resourceWatcher.TYPES.THREAD_STATE], { onAvailable: onBreakpointAvailable, }); + resourceWatcher.unwatchResources([resourceWatcher.TYPES.ERROR_MESSAGE], { + onAvailable: actions.addExceptionFromResources, + }); sourceQueue.clear(); }