From 9b4b399c593f88d5a777bdaaf0e46c12d2aced51 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 2 Nov 2024 18:34:37 +0100 Subject: [PATCH] Refactor ZenGlanceManager.mjs to simplify closing of glance by removing unnecessary animation option and handle quitting application when closing glance --- src/ZenGlanceManager.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ZenGlanceManager.mjs b/src/ZenGlanceManager.mjs index ba7262f..b1c4163 100644 --- a/src/ZenGlanceManager.mjs +++ b/src/ZenGlanceManager.mjs @@ -173,6 +173,7 @@ this.lastCurrentTab = this.#currentTab; this.overlay.classList.remove("zen-glance-overlay"); + gBrowser._getSwitcher().setTabStateNoAction(this.lastCurrentTab, gBrowser.AsyncTabSwitcher.STATE_UNLOADED); if (!onTabClose && gBrowser.selectedTab === this.lastCurrentTab) { this._duringOpening = true; @@ -187,9 +188,9 @@ this.lastCurrentTab.removeAttribute("zen-glance-tab"); - this.#currentTab.remove(); - this.#currentBrowser.destroy(); - this.#currentBrowser.closest(".browserSidebarContainer").remove(); + gBrowser.tabContainer._invalidateCachedTabs(); + gBrowser.removeTab(this.lastCurrentTab, { animate: false }); + this.#currentTab = null; this.#currentBrowser = null;