mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-04 17:07:23 +00:00
pages/search: add favicon fallback
This commit is contained in:
parent
fcafefb334
commit
77561ae793
2 changed files with 9 additions and 0 deletions
|
|
@ -26,3 +26,11 @@ export const updateSearchResults = (state) => {
|
||||||
const container = document.getElementById('searchResults')
|
const container = document.getElementById('searchResults')
|
||||||
container.innerHTML = state.results.map(tabView).join('')
|
container.innerHTML = state.results.map(tabView).join('')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const enableFaviconFallback = () => {
|
||||||
|
window.addEventListener('error', (e) => {
|
||||||
|
if (e.target.tagName === 'IMG') {
|
||||||
|
e.target.src = defaultFavicon
|
||||||
|
}
|
||||||
|
}, true)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,4 @@ const store = Store.init({
|
||||||
})
|
})
|
||||||
|
|
||||||
void inputHandlers.attachInputHandlers(store)
|
void inputHandlers.attachInputHandlers(store)
|
||||||
|
void dom.enableFaviconFallback()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue