mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
use original page favicon in reader
This commit is contained in:
parent
c97d3f35e8
commit
b85f619290
|
|
@ -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))))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue