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:
parent
dad9475005
commit
8b25b0bbf3
1 changed files with 4 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue