summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-23 20:06:22 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-23 20:06:22 +0100
commit56da5423c06ff67a53e14a2a1c7aab6e0020d3d3 (patch)
tree43246a2220256012f2e7d521d0f6cb61fc0975ce /misc
parentf7e91657877b95ff786139f5f3bd5d5e70c11a18 (diff)
parent173a05944c9ee69481e127a5f5ba36653ed9affb (diff)
downloadqutebrowser-56da5423c06ff67a53e14a2a1c7aab6e0020d3d3.tar.gz
qutebrowser-56da5423c06ff67a53e14a2a1c7aab6e0020d3d3.zip
Merge remote-tracking branch 'origin/pr/6263'
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/userscripts/readability-js15
1 files changed, 14 insertions, 1 deletions
diff --git a/misc/userscripts/readability-js b/misc/userscripts/readability-js
index d9474aeb1..bb681810c 100755
--- a/misc/userscripts/readability-js
+++ b/misc/userscripts/readability-js
@@ -52,6 +52,15 @@ const HEADER = `
h1, h2, h3 {
line-height: 1.2;
}
+ h1.reader-title {
+ font-size: 1.85em;
+ line-height: 1.25em;
+ width: 100%;
+ margin: 0 0;
+ }
+ a.reader-title {
+ color: #FFFFFF !important;
+ }
img {
max-width:100%;
height:auto;
@@ -108,6 +117,9 @@ const HEADER = `
yaDhjMS4xMSAwIDItMC44OTUgMi0ycy0wLjg5NS0yLTItMnoiIGZpbGw9IiNmZmYiLz4KPC9nPgo8L3N2Zz4K"/>
</head>
<body class="qute-readability">
+ <h1 class="reader-title">%s</h1>
+ <div>From <a class="reader-title" href="%s">%s</a></div>
+ <hr>
%s
</body>
</html>
@@ -134,7 +146,8 @@ else {
getDOM(target, domOpts).then(dom => {
let reader = new Readability(dom.window.document);
let article = reader.parse();
- let content = util.format(HEADER, article.title, article.content);
+ let subtitle = (article.siteName == null) ? new URL(process.env.QUTE_URL).hostname : article.siteName;
+ let content = util.format(HEADER, article.title, article.title, process.env.QUTE_URL, subtitle, article.content);
fs.writeFile(tmpFile, content, (err) => {
if (err) {