WIP: silly first go at own reader mode

This commit is contained in:
Oliver Blanthorn 2021-01-31 21:07:46 +01:00
parent 2b6a27c678
commit c0635bf3ab
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 15 additions and 0 deletions

View file

@ -13,6 +13,7 @@
}, },
"dependencies": { "dependencies": {
"cleanslate": "^0.10.1", "cleanslate": "^0.10.1",
"@mozilla/readability": "^0.4.1",
"csp-serdes": "github:cmcaine/csp-serdes", "csp-serdes": "github:cmcaine/csp-serdes",
"css": "^3.0.0", "css": "^3.0.0",
"editor-adapter": "^0.0.5", "editor-adapter": "^0.0.5",

View file

@ -5986,6 +5986,15 @@ export async function extoptions(...optionNameArgs: string[]) {
return winopen("-popup", selectedExtension.optionsUrl) return winopen("-popup", selectedExtension.optionsUrl)
} }
//#content_helper
import { Readability } from "@mozilla/readability"
//#content
export async function reader2() {
const article = new Readability(document).parse()
document.body.innerHTML = article.content
}
/** /**
* Restore the most recently hidden element. Repeated invocations restore the next-most-recently-hidden element. * Restore the most recently hidden element. Repeated invocations restore the next-most-recently-hidden element.
* *

View file

@ -767,6 +767,11 @@
resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.2.29.tgz#7f29e9a108aaf789600dd36e8442fe89ab41a815" resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.2.29.tgz#7f29e9a108aaf789600dd36e8442fe89ab41a815"
integrity sha512-bEBrkTWbDAs/PB4IdRg4CtU750oBRytXHK/wC2oIDkgKZqnt76nACSooQQuHF11mK5k43f/IgFUMO5t5quRPVA== integrity sha512-bEBrkTWbDAs/PB4IdRg4CtU750oBRytXHK/wC2oIDkgKZqnt76nACSooQQuHF11mK5k43f/IgFUMO5t5quRPVA==
"@mozilla/readability@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@mozilla/readability/-/readability-0.4.1.tgz#e112a625b25ac47659d33b37e080748a6d85218b"
integrity sha512-yar/f0w0fRUVM895s6yd5Z2oIxjG/6c3ROB/uQboSOBaDlri/nqI4aKtdqrldWciTLcdpjB2Z6MiVF2Bl9b8LA==
"@nodelib/fs.scandir@2.1.3": "@nodelib/fs.scandir@2.1.3":
version "2.1.3" version "2.1.3"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"