Update the favicon if available in the feed
This commit is contained in:
parent
897d12ed4e
commit
dfd75221ca
2 changed files with 8 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue