mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Add title and author to reader mode
This commit is contained in:
parent
04df34d9c7
commit
a06d6849c0
|
|
@ -5998,6 +5998,18 @@ export async function reader2() {
|
|||
stylelink.rel = "stylesheet"
|
||||
stylelink.href = browser.runtime.getURL("static/css/reader.css")
|
||||
document.head.appendChild(stylelink)
|
||||
if (article.title !== undefined) {
|
||||
const header = document.createElement("header")
|
||||
const title = document.createElement("h1")
|
||||
title.textContent = article.title
|
||||
header.appendChild(title)
|
||||
if (article.byline !== undefined) {
|
||||
const author = document.createElement("p")
|
||||
author.textContent = article.byline
|
||||
header.appendChild(author)
|
||||
}
|
||||
document.body.insertBefore(header, document.body.firstChild)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue