From 8b25b0bbf31e291e78849401c27fd25a0a4fe74c Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Fri, 30 May 2025 19:37:35 +0200 Subject: [PATCH] feat: Set a new favicon to pinned tabs if previous didn't exist, b=(no-bug), c=tabs --- src/zen/tabs/ZenPinnedTabManager.mjs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index 56ef429d..e92ba660 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -93,19 +93,9 @@ if (!iconUrl && tab.hasAttribute('zen-pin-id')) { try { setTimeout(async () => { - try { - await this.promisePinnedCacheInitialized; - const pin = this._pinsCache?.find( - (pin) => pin.uuid === tab.getAttribute('zen-pin-id') - ); - let favicon = await PlacesUtils.favicons.getFaviconForPage( - Services.io.newURI(pin.url) - ); - if (favicon) { - gBrowser.setIcon(tab, favicon.dataURI); - } - } catch (error) { - console.warn('Error getting favicon URL:', error); + const favicon = await this.getFaviconAsBase64(tab.linkedBrowser.currentURI); + if (favicon) { + gBrowser.setIcon(tab, favicon); } }); } catch {} @@ -651,8 +641,7 @@ return faviconData.dataURI; } catch (ex) { console.error('Failed to get favicon:', ex); - // console.error("Failed to get favicon:", ex); - return `page-icon:${pageUrl}`; // Use this as a fallback + return null; } }