From 92210e430d4ed69720b3439d29a3d36f6231c29b Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Thu, 14 Dec 2023 09:36:46 +0100 Subject: [PATCH] Update sites: fix Google webcache --- background.js | 2 +- changelog.txt | 1 + contentScript.js | 16 +++------------- custom/manifest.json | 2 +- custom/sites_custom.json | 7 +------ manifest.json | 2 +- 6 files changed, 8 insertions(+), 22 deletions(-) diff --git a/background.js b/background.js index de840ff..c337d3b 100644 --- a/background.js +++ b/background.js @@ -1514,7 +1514,7 @@ ext_api.runtime.onMessage.addListener(function (message, sender) { getArticleSrc(message); function getArticleSrc(message) { let url_src = message.data.url_src || message.data.url; - fetch(message.data.url_src) + fetch(url_src) .then(response => { if (response.ok) { response.text().then(html => { diff --git a/changelog.txt b/changelog.txt index 1b5d044..44339d7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -12,6 +12,7 @@ Remove Nordwest Zeitung (fix obsolete) Remove Wissenschaft.de (fix obsolete) Fix Australia News Corp (media on amp) Fix Faz.net (disable Zeitung subdomain) +Update sites: fix Google webcache * v3.4.6.0 (2023-12-10) Remove Morgenpost.de (Funke; fix obsolete) diff --git a/contentScript.js b/contentScript.js index ebfa69b..ad14015 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3779,17 +3779,7 @@ else if (matchDomain('defector.com')) { let pars = article.querySelectorAll('p'); if (pars.length < 3) { let url = window.location.href.split('?')[0]; - fetch(url) - .then(response => { - if (response.ok) { - response.text().then(html => { - let parser = new DOMParser(); - let doc = parser.parseFromString(DOMPurify.sanitize(html, dompurify_options), 'text/html'); - let article_new = doc.querySelector(article_sel); - article.parentNode.replaceChild(article_new, article); - }); - } - }); + replaceDomElementExt(url, false, false, article_sel); } }, 1000); } @@ -4421,7 +4411,7 @@ else if (matchDomain('newrepublic.com')) { else if (matchDomain('newscientist.com')) { let url = window.location.href; - func_post = function () { + let func_post = function () { let lazy_images = document.querySelectorAll('img.lazyload[data-src]:not([src])'); for (let elem of lazy_images) elem.src = elem.getAttribute('data-src').split('?')[0] + '?width=800'; @@ -5871,7 +5861,7 @@ function replaceDomElementExt(url, proxy, base64, selector, text_fail = '', sele let article = document.querySelector(selector); if (response.ok) { response.text().then(html => { - replaceDomElementExtSrc(url, html, false, base64, selector, text_fail, selector_source); + replaceDomElementExtSrc(url, '', html, false, base64, selector, text_fail, selector_source); }); } else { replaceTextFail(url, article, proxy, text_fail); diff --git a/custom/manifest.json b/custom/manifest.json index ca32929..2afaa91 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.4.6.4" + "version": "3.4.6.5" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index f3cd6c3..0ed7afc 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -1,6 +1,6 @@ { "###_remove_sites": { - "cs_code": "africaintelligence.fr, arkansasonline.com, columbian.com, die-glocke.de, doorbraak.be, gp.se, intelligenceonline.com, intelligenceonline.fr, interestingengineering.com, jeuneafrique.com, lalettrea.fr, lastampa.it, lavozdegalicia.es, law360.com, lepoint.fr, limburger.nl, manager-magazin.de, ouest-france.fr, pressherald.com, repubblica.it, risk.net, saechsische.de, sueddeutsche.de, swarajyamag.com, theepochtimes.com, theinformation.com, thestage.co.uk, thetexan.news, theweek.com, vikatan.com", + "cs_code": "africaintelligence.fr, al-monitor.com, arkansasonline.com, columbian.com, die-glocke.de, doorbraak.be, gp.se, intelligenceonline.com, intelligenceonline.fr, interestingengineering.com, jeuneafrique.com, lalettrea.fr, lastampa.it, lavozdegalicia.es, law360.com, lepoint.fr, limburger.nl, manager-magazin.de, ouest-france.fr, pressherald.com, repubblica.it, risk.net, saechsische.de, sueddeutsche.de, swarajyamag.com, theepochtimes.com, theinformation.com, thestage.co.uk, thetexan.news, theweek.com, vikatan.com", "domain": "###" }, "Abajournal.com": { @@ -19,11 +19,6 @@ "allow_cookies": 1, "domain": "airmail.news" }, - "Al-monitor.com": { - "allow_cookies": 1, - "cs_code": "[{\"cond\":\"body.nodetype--memo\", \"rm_class\":\"nodetype--memo\"}, {\"cond\":\"div.memo--callout--wrapper\",\"rm_elem\":1}]", - "domain": "al-monitor.com" - }, "Artsprofessional.co.uk": { "allow_cookies": 1, "block_regex": "\\.artsprofessional\\.co\\.uk\\/.+\\/js\\/content_paywall\\.js", diff --git a/manifest.json b/manifest.json index fe921a9..3dcd884 100644 --- a/manifest.json +++ b/manifest.json @@ -822,5 +822,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.4.6.4" + "version": "3.4.6.5" }