mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Add title and author to reader mode
This commit is contained in:
parent
04df34d9c7
commit
a06d6849c0
1 changed files with 12 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue