Skip to content

Commit 8b25b0b

Browse files
committed
feat: Set a new favicon to pinned tabs if previous didn't exist, b=(no-bug), c=tabs
1 parent dad9475 commit 8b25b0b

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/zen/tabs/ZenPinnedTabManager.mjs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,9 @@
9393
if (!iconUrl && tab.hasAttribute('zen-pin-id')) {
9494
try {
9595
setTimeout(async () => {
96-
try {
97-
await this.promisePinnedCacheInitialized;
98-
const pin = this._pinsCache?.find(
99-
(pin) => pin.uuid === tab.getAttribute('zen-pin-id')
100-
);
101-
let favicon = await PlacesUtils.favicons.getFaviconForPage(
102-
Services.io.newURI(pin.url)
103-
);
104-
if (favicon) {
105-
gBrowser.setIcon(tab, favicon.dataURI);
106-
}
107-
} catch (error) {
108-
console.warn('Error getting favicon URL:', error);
96+
const favicon = await this.getFaviconAsBase64(tab.linkedBrowser.currentURI);
97+
if (favicon) {
98+
gBrowser.setIcon(tab, favicon);
10999
}
110100
});
111101
} catch {}
@@ -651,8 +641,7 @@
651641
return faviconData.dataURI;
652642
} catch (ex) {
653643
console.error('Failed to get favicon:', ex);
654-
// console.error("Failed to get favicon:", ex);
655-
return `page-icon:${pageUrl}`; // Use this as a fallback
644+
return null;
656645
}
657646
}
658647

0 commit comments

Comments
 (0)