From 5e4ea9889cbb26930eb9f52a7b27132d40da7c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristijan=20Ribari=C4=87?= Date: Sat, 12 Oct 2024 21:52:07 +0200 Subject: [PATCH] Fix: Update pinned tab entries to include triggering principal This commit updates the pinned tab entries to include the triggering principal. Previously, the pinned tab entries only included the URL and title of the tab. This caused issues when restoring pinned tabs, as the triggering principal was not being saved. This commit adds the triggering principal to the pinned tab entries, ensuring that they can be restored correctly. This fixes the issue where pinned tabs were not being restored correctly. --- src/ZenPinnedTabManager.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ZenPinnedTabManager.mjs b/src/ZenPinnedTabManager.mjs index 8f0cbb2..6d27686 100644 --- a/src/ZenPinnedTabManager.mjs +++ b/src/ZenPinnedTabManager.mjs @@ -95,10 +95,13 @@ _setPinnedAttributes(tab) { const browser = tab.linkedBrowser; - const tabState = JSON.parse(SessionStore.getTabState(tab)); - const activeEntry = tabState.entries[tabState.index - 1]; + const entry = { + url: browser.currentURI.spec, + title: tab.label || browser.contentTitle, + triggeringPrincipal_base64: lazy.E10SUtils.SERIALIZED_SYSTEMPRINCIPAL + }; - tab.setAttribute("zen-pinned-entry", JSON.stringify(activeEntry)); + tab.setAttribute("zen-pinned-entry", JSON.stringify(entry)); tab.setAttribute("zen-pinned-icon", browser.mIconURL); }