From 6961b0693c7f90260d31b3db55d2e1f9140130a3 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 18 Mar 2024 13:35:34 +0100 Subject: [PATCH] Fix Expresso.pt (json) Fix The Athletic (scroll) --- changelog.txt | 2 ++ contentScript.js | 10 +++++++--- custom/manifest.json | 2 +- manifest.json | 2 +- sites_updated.json | 36 ------------------------------------ updates.json | 4 ++-- 6 files changed, 13 insertions(+), 43 deletions(-) diff --git a/changelog.txt b/changelog.txt index 3090df0..3d4533b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,8 @@ Changelog Bypass Paywalls Clean - Firefox Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases Post-release +Fix Expresso.pt (json) +Fix The Athletic (scroll) * v3.6.0.0 (2024-03-17) Add Courrier international diff --git a/contentScript.js b/contentScript.js index 22bf11c..dc61d8f 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1712,11 +1712,14 @@ else if (matchDomain('expresso.pt')) { try { article.innerHTML = ''; let json = JSON.parse(html.split(/window\.__INITIAL_DATA__\s?=\s?/)[1].split(';window.')[0].replace(/":undefined([,}])/g, "\":\"undefined\"$1")).nodes; - let pars; + let pars = []; for (let elem in json) { let item = json[elem]; - if (item.type === 'Layout' && item.nodes[0].type === 'MainBody') { - pars = item.nodes[0].nodes[0].data.content.contents; + if (item.type === 'Layout') { + for (let elem of item.nodes) { + if (elem.type === 'MainBody') + pars = elem.nodes[0].data.content.contents; + } break; } } @@ -5285,6 +5288,7 @@ else if (matchDomain('theathletic.com')) { if (body) { body.style.overflow = 'visible'; body.style.position = 'relative'; + window.scrollTo(0, 1000); } } waitDOMElement('div[id^="slideup-"]', 'DIV', theathletic_func); diff --git a/custom/manifest.json b/custom/manifest.json index c88c631..f7cb62c 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.6.0.0" + "version": "3.6.0.1" } diff --git a/manifest.json b/manifest.json index 73d2e93..5fb96f8 100644 --- a/manifest.json +++ b/manifest.json @@ -860,5 +860,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.6.0.0" + "version": "3.6.0.1" } diff --git a/sites_updated.json b/sites_updated.json index 362ffa1..706cde2 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -30,19 +30,6 @@ "ld_archive_is": "div#paywall-container|article", "upd_version": "3.5.8.3" }, - "Haaretz Group": { - "domain": "###_il_haaretz_group", - "group": [ - "haaretz.co.il", - "haaretz.com", - "themarker.com" - ], - "allow_cookies": 1, - "block_regex": "\\.co(m|\\.il)\\/.+\\/magazine\\/page-.+\\.js", - "cs_dompurify": 1, - "useragent_custom": "Mozilla/5.0 (Java) outbrain", - "upd_version": "3.5.7.2" - }, "Hearst Communications (newspapers)": { "domain": "###_usa_hearst_comm", "group": [ @@ -58,24 +45,12 @@ "cs_code": "[{\"cond\":\"div#modals\", \"rm_elem\":1}, {\"cond\":\"body[style]\", \"rm_attrib\":\"style\"}]", "upd_version": "3.5.8.5" }, - "Il Sole 24 Ore": { - "domain": "ilsole24ore.com", - "allow_cookies": 1, - "block_regex": "(\\.ilsole24ore\\.com\\/zephr\\/feature|\\.cloudfront\\.net\\/embed\\/widget\\/subx.+\\.js)", - "upd_version": "3.5.7.7" - }, "LeMoniteur.fr": { "domain": "lemoniteur.fr", "allow_cookies": 1, "ld_google_webcache": "div.blocPasEncoreAbonne|div.articleContent", "upd_version": "3.5.9.7" }, - "Medscape (regwall)": { - "domain": "medscape.com", - "allow_cookies": 1, - "block_regex": "(\\.medscapestatic\\.com\\/.+\\/medscape-library|\\.wbmdstatic\\.com\\/.+\\/chunk-vendors\\..+)\\.js", - "upd_version": "3.5.7.6" - }, "Mid-Day": { "domain": "mid-day.com", "allow_cookies": 1, @@ -116,17 +91,6 @@ "nofix": 1, "upd_version": "3.5.8.1" }, - "SPH Media": { - "domain": "###_sg_sph_media", - "group": [ - "straitstimes.com" - ], - "allow_cookies": 1, - "add_ext_link": "div#nocx_paywall_area|main#content", - "add_ext_link_type": "archive.is", - "ld_archive_is": "div#nocx_paywall_area|main#content", - "upd_version": "3.5.7.1" - }, "Südkurier": { "domain": "suedkurier.de", "allow_cookies": 1, diff --git a/updates.json b/updates.json index 6a45be5..d0b0e95 100644 --- a/updates.json +++ b/updates.json @@ -2,8 +2,8 @@ "addons": { "magnolia@12.34": { "updates": [ - { "version": "3.5.9.0", - "update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.5.9.0.xpi" } + { "version": "3.6.0.0", + "update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.6.0.0.xpi" } ] } }