Hide tab favicon on image load error
Adds an onerror handler to tab favicon images to hide them if the favicon fails to load, improving the appearance of tabs with missing or broken favicon URLs.
This commit is contained in:
@@ -1029,6 +1029,9 @@ function renderTabs() {
|
|||||||
const icon = document.createElement('img');
|
const icon = document.createElement('img');
|
||||||
icon.src = tab.favicon;
|
icon.src = tab.favicon;
|
||||||
icon.className = 'tab-favicon';
|
icon.className = 'tab-favicon';
|
||||||
|
icon.onerror = function() {
|
||||||
|
this.style.display = 'none';
|
||||||
|
};
|
||||||
el.appendChild(icon);
|
el.appendChild(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user