diff --git a/src/utils.ts b/src/utils.ts index 68ed31b..19bc114 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -148,9 +148,10 @@ class AddonUtils extends AddonModule { Services.wm.addListener(windowListener); }, unregisterPrefPane: () => { - this.Compat.prefPaneCache.listeners.forEach((l) => - Services.wm.removeListener(l) - ); + this.Compat.prefPaneCache.listeners.forEach((l) => { + Services.wm.removeListener(l); + l.onOpenWindow = undefined; + }); const win = this.Compat.prefPaneCache.win; if (win && !win.closed) { this.Compat.prefPaneCache.ids.forEach((id) =>