From 736f8f14cfabf888842d777f2992543e55feefbc Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 5 Feb 2021 19:07:38 +0100 Subject: [PATCH] Fix-update Sud Ouest (decode text) --- changelog.txt | 1 + contentScript.js | 16 ++++++++++++++-- manifest.json | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index a892ee9..1623835 100644 --- a/changelog.txt +++ b/changelog.txt @@ -8,6 +8,7 @@ Rheinische Post Mediengruppe (only plus if amp) Fix-update Madsack Mediengruppe (amp) Fix-update Medium/Towards Data Science (login) & add custom domains in options Fix-update Stratfor (style; not menu) +Fix-update Sud Ouest (decode text) * v2.0.6.0 (2021-01-31) Add Griffith Review (Australia) diff --git a/contentScript.js b/contentScript.js index aae5445..a2d4930 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1896,9 +1896,13 @@ else if (matchDomain('sudouest.fr')) { } removeDOMElement(paywall); } + window.setTimeout(function () { + let footer_premium = document.querySelector('.footer-premium'); + removeDOMElement(footer_premium); + }, 500); // Delay (in milliseconds) } -else if (matchDomain('ruhrnachrichten.de')) { +else if (matchDomain(['ruhrnachrichten.de', 'hellwegeranzeiger.de'])) { let paywall = document.querySelector('.PianoContent'); if (paywall) paywall.classList.remove('PianoContent'); @@ -2118,7 +2122,7 @@ function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') { if (response.ok) { response.text().then(html => { if (base64) { - html = atob(html); + html = decode_utf8(atob(html)); selector = 'body'; } let parser = new DOMParser(); @@ -2212,3 +2216,11 @@ function parseHtmlEntities(encodedString) { return String.fromCharCode(num); }); } + +function encode_utf8(str) { + return unescape(encodeURIComponent(str)); +} + +function decode_utf8(str) { + return decodeURIComponent(escape(str)); +} diff --git a/manifest.json b/manifest.json index 4f6e344..8ba3ba5 100644 --- a/manifest.json +++ b/manifest.json @@ -456,5 +456,5 @@ "*://*.userzoom.com/*", "*://*.wsj.net/*" ], - "version": "2.0.6.5" + "version": "2.0.6.6" } \ No newline at end of file