use original page favicon in reader

This commit is contained in:
Chic-Tweetz 2025-10-17 11:33:39 +01:00
parent c97d3f35e8
commit b85f619290
2 changed files with 7 additions and 0 deletions

View file

@ -6223,6 +6223,7 @@ export async function readerurl() {
document.querySelectorAll(".TridactylStatusIndicator").forEach(ind => ind.parentNode.removeChild(ind))
const article = new Readability(document.cloneNode(true) as any as Document).parse()
article["link"] = window.location.href
article["favicon"] = (await ownTab()).favIconUrl
return browser.runtime.getURL("static/reader.html#" + btoa(encodeURIComponent(JSON.stringify(article))))
}

View file

@ -45,6 +45,12 @@ async function updatePage() {
} else {
document.getElementById("tricanonlink")?.remove()
}
if (article.favicon !== undefined) {
const icon = document.createElement("link")
icon.rel = "icon"
icon.href = article.favicon
document.head.appendChild(icon)
}
}
window.addEventListener("load", updatePage)