Fix Faz.net (json)

This commit is contained in:
magnolia1234 2023-03-20 20:01:19 +01:00
parent 7292c895f1
commit 1f9428b634
4 changed files with 5 additions and 4 deletions

View file

@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox
Updates: https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases
Post-release
Fix Faz.net (json)
* v3.1.0.0 (2023-03-19)
Add Defector

View file

@ -648,7 +648,7 @@ else if (matchDomain('faz.net')) {
let split1 = json_text.split('"ArticleBody": "');
let split2 = split1[1].split('","author":');
if (split2[0].includes('"'))
json_text = split1[0] + '"ArticleBody": "' + split2[0].replace(/"/g, '“') + '","author":' + split2[1];
json_text = split1[0] + '"ArticleBody": "' + split2[0].replace(/(\\)?"/g, "'") + '","author":' + split2[1];
try {
json_text = JSON.parse(json_text).ArticleBody;
} catch (err) {
@ -5040,7 +5040,7 @@ function pageContains(selector, text) {
}
function breakText(str) {
str = str.replace(/(?:^|[A-Za-z\"\“])(\.|\?|!)(?=[A-ZÖÜ\„\d][A-Za-zÀ-ÿ\„\d]{1,})/gm, "$&\n\n");
str = str.replace(/(?:^|[A-Za-z\"\“\)])(\.|\?|!)(?=[A-ZÖÜ\„\d][A-Za-zÀ-ÿ\„\d]{1,})/gm, "$&\n\n");
str = str.replace(/(([a-z]{2,}|[\"\“]))(?=[A-Z](?=[A-Za-zÀ-ÿ]+))/gm, "$&\n\n");
// exceptions: names with alternating lower/uppercase (no general fix)
let str_rep_arr = ['AstraZeneca', 'BaFin', 'BerlHG', 'BfArM', 'BilMoG', 'BioNTech', 'DiGA', 'EuGH', 'FinTechRat', 'GlaxoSmithKline', 'IfSG', 'medRxiv', 'mmHg', 'PlosOne', 'StVO'];

View file

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.1.0.0"
"version": "3.1.0.1"
}

View file

@ -740,5 +740,5 @@
"*://*.wallkit.net/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.1.0.0"
"version": "3.1.0.1"
}