From ed7ce7c8d34b4d89f894ce069fa37e789f571ecf Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Tue, 29 Oct 2024 10:21:39 +0100 Subject: [PATCH] Refactor ZenGlanceManager.mjs to open new tabs in the background and skip loading, and append the new tab to the glance tabs container. Increase the delay for removing the current tab to 500ms. --- src/ZenGlanceManager.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ZenGlanceManager.mjs b/src/ZenGlanceManager.mjs index b76796b..167b074 100644 --- a/src/ZenGlanceManager.mjs +++ b/src/ZenGlanceManager.mjs @@ -70,10 +70,12 @@ console.log(url); const newTabOptions = { userContextId: currentTab.getAttribute("usercontextid") || "", - inBackground: false, + inBackground: true, + skipLoading: true, insertTab: false, }; const newTab = gBrowser.addTrustedTab(url, newTabOptions); + document.getElementById("zen-glance-tabs").appendChild(newTab); this.#currentBrowser = newTab.linkedBrowser; this.#currentTab = newTab; return this.#currentBrowser; @@ -147,7 +149,7 @@ this.#currentTab?.remove(); this.#currentBrowser = null; this.#currentTab = null; - }, 300); + }, 500); }); }); }