1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 21:49:58 +02:00

feat: Set a new favicon to pinned tabs if previous didn't exist, b=(no-bug), c=tabs

This commit is contained in:
mr. m 2025-05-30 19:37:35 +02:00
parent dad9475005
commit 8b25b0bbf3
No known key found for this signature in database
GPG key ID: 419302196C23B258

View file

@ -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;
}
}