Update the favicon if available in the feed

This commit is contained in:
Fabio Manganiello 2023-01-20 23:35:28 +01:00
parent 897d12ed4e
commit dfd75221ca
2 changed files with 8 additions and 0 deletions

View File

@ -59,6 +59,7 @@ const parseAtomFeed = (feed: Element, url: string | null) => {
description: getNodeContent(feed, 'subtitle'),
feedUrl: url?.length ? url : window.location.href,
homeUrl: homeURL,
iconUrl: iconURL,
image: {
imageUrl: logoURL || iconURL,
targetUrl: homeURL,

View File

@ -64,6 +64,13 @@ export default {
async mounted() {
this.feed = (await browser.storage.local.get('feedData'))?.feedData || {}
if (this.feed.iconUrl) {
const link = document.querySelector("link[rel*='icon']") || document.createElement('link')
link.type = 'image/x-icon'
link.rel = 'shortcut icon'
link.href = this.feed.iconUrl
document.getElementsByTagName('head')[0].appendChild(link)
}
},
}
</script>