rosenrot-browser

A hackable browser based on Webkitgtk
Log | Files | Refs | README

commit 6a330e9b09d05873213fd949bed0fb8b5e0c7ad1
parent 86fef30c22582896f468b9cb1b1c8dbd3043e1f5
Author: NunoSempere <nuno.sempere@protonmail.com>
Date:   Tue, 14 Feb 2023 02:07:23 +0100

tweak: nicer blockquotes

also fix bug in archive.is / bloomberg.

Diffstat:
Mplugins/readability/readability.c | 2+-
Mplugins/readability/readability.h | 2+-
Mplugins/readability/readability.js | 36++++++++++++++++++++++++++++++++++++
Mplugins/readability/recompute_READABILITY_N.sh | 2+-
4 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/plugins/readability/readability.c b/plugins/readability/readability.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#define READABILITY_N 84251 + 1 +#define READABILITY_N 84824 + 1 void read_readability_js(char* string){ FILE *fp=fopen("/home/loki/Documents/core/software/fresh/C/rose-browser/rose-browser/plugins/readability/readability.js", "r"); diff --git a/plugins/readability/readability.h b/plugins/readability/readability.h @@ -1,7 +1,7 @@ #ifndef READABILITY #define READABILITY -#define READABILITY_N 84251 + 1 +#define READABILITY_N 84824 + 1 void read_readability_js(char* string); diff --git a/plugins/readability/readability.js b/plugins/readability/readability.js @@ -2319,6 +2319,21 @@ body { left: 0; width: 100%; } + +/* Block quotes */ + +blockquote{ + width:60%; + margin: 5px auto; + font-style:italic; + color: #555555; + padding: 1.2em 30px 1.2em 75px; + border-left:8px solid #005386 ; + line-height:1.3; + position: relative; + background: #F0F0F0; +} + </style>` /* @@ -2338,3 +2353,24 @@ var documentClone = document.cloneNode(true); var article = new Readability(documentClone).parse(); document.head.innerHTML = `<title>${article.title}</title>\n${style_sheet_simple}` document.body.innerHTML = `<h1>${article.title}</h1>\n${article.content}` + + +/* Hack for archive.is */ +var styles + +if (document.domain == "archive.is" ){ + styles = ` + + li > span { + display: none; !important + } + + ` +} + +if(styles != null){ + var styleSheet = document.createElement('style') + styleSheet.innerText = styles + document.head.appendChild(styleSheet) + console.log('Style changed') +} diff --git a/plugins/readability/recompute_READABILITY_N.sh b/plugins/readability/recompute_READABILITY_N.sh @@ -3,6 +3,6 @@ function sedr(){ find ./ -type f -exec sed -i -e "$1" {} \; } ## e.g., sedr "s/target/replacement/g" -READABILITY_N=$(wc -c ./plugins/*/readability.js | cut -d " " -f 1) +READABILITY_N=$(wc -c readability.js | cut -d " " -f 1) sedr "s/^#define READABILITY_N .*/#define READABILITY_N $READABILITY_N + 1/g"