fix: unregisterPrefPane

This commit is contained in:
xiangyu 2022-12-16 20:06:40 +08:00
parent 5b99dfe8ba
commit dcf82a360f

View File

@ -148,9 +148,10 @@ class AddonUtils extends AddonModule {
Services.wm.addListener(windowListener); Services.wm.addListener(windowListener);
}, },
unregisterPrefPane: () => { unregisterPrefPane: () => {
this.Compat.prefPaneCache.listeners.forEach((l) => this.Compat.prefPaneCache.listeners.forEach((l) => {
Services.wm.removeListener(l) Services.wm.removeListener(l);
); l.onOpenWindow = undefined;
});
const win = this.Compat.prefPaneCache.win; const win = this.Compat.prefPaneCache.win;
if (win && !win.closed) { if (win && !win.closed) {
this.Compat.prefPaneCache.ids.forEach((id) => this.Compat.prefPaneCache.ids.forEach((id) =>