pages/search: add favicon fallback

This commit is contained in:
He4eT 2024-01-22 02:42:38 +01:00
commit 77561ae793
2 changed files with 9 additions and 0 deletions

View file

@ -26,3 +26,11 @@ export const updateSearchResults = (state) => {
const container = document.getElementById('searchResults')
container.innerHTML = state.results.map(tabView).join('')
}
export const enableFaviconFallback = () => {
window.addEventListener('error', (e) => {
if (e.target.tagName === 'IMG') {
e.target.src = defaultFavicon
}
}, true)
}