From ba9d97d8b53884b94c65051c794577b01099ad7c Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 19 Jul 2023 12:31:04 +0200 Subject: [PATCH] Fix Puck.news (cached articles only) --- changelog.txt | 3 ++- contentScript.js | 12 ++++++------ custom/manifest.json | 2 +- custom/sites_custom.json | 11 +++++++++++ manifest.json | 2 +- sites.js | 3 +-- sites_updated.json | 30 +++++++++++++++++++++++++++--- 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/changelog.txt b/changelog.txt index c6f6940..18c4f90 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,8 +6,9 @@ Post-release Add Schwarzwaelder-bote.de & Stuttgarter-nachrichten.de Fix Australian Community Media (css) Fix Medium (identify member-only) +Fix Puck.news (cached articles only) Fix Star Tribune (images/comments) -Maintenance request host permission (disable for mobile) +Maintenance request host permission (disabled for mobile) * v3.2.5.0 (2023-07-16) Add El Tribuno (ar) diff --git a/contentScript.js b/contentScript.js index a00169b..2d3a007 100644 --- a/contentScript.js +++ b/contentScript.js @@ -308,7 +308,7 @@ if (matchDomain('medium.com') || matchDomain(medium_custom_domains) || document. article.firstChild.before(googleWebcacheLink(url)); } window.setTimeout(function () { - let banner = pageContains('div > h2 > div, div > div > h2', /(Read (the full story with|this story from)|Get unlimited access to stories)/); + let banner = pageContains('div > h2 > div, div > div > h2', /(Read (the full story with|this story from)|Get unlimited access to)/); if (banner.length) removeDOMElement(banner[0].parentNode.parentNode); }, 1000); @@ -428,7 +428,7 @@ else { window.setTimeout(function () { let breach_screen = document.querySelector('div.paywall div[data-testid*="BreachScreen"], div[class*="StyledBreachWallContent"]'); if (breach_screen) { - let scripts = document.querySelectorAll('script:not([src], [type])'); + let scripts = document.querySelectorAll('script:not([src]):not([type])'); let json_script; for (let script of scripts) { if (script.text.includes('window.PAGE_DATA =')) { @@ -2381,7 +2381,7 @@ else if (matchDomain('telegraaf.nl')) { div_main.style = 'margin: 20px 0px;'; let div_elem = document.createElement('div'); let par_style = 'font-weight: normal; font-size: 16px; line-height: 1.5;'; - let scripts = document.querySelectorAll('script:not([src], [type])'); + let scripts = document.querySelectorAll('script:not([src]):not([type])'); let apollo_script; for (let script of scripts) { if (script.text.includes('window.__APOLLO_STATE__=')) { @@ -4249,9 +4249,9 @@ else if (matchDomain('project-syndicate.org')) { else if (matchDomain('puck.news')) { let url = window.location.href; - let paywall = document.querySelector('div.paywall'); - if (paywall) { - removeDOMElement(paywall); + let paywall = document.querySelectorAll('div[class*="paywall"]'); + if (paywall.length) { + removeDOMElement(...paywall); csDoneOnce = true; let url_cache = 'https://webcache.googleusercontent.com/search?q=cache:' + url.split('?')[0]; replaceDomElementExt(url_cache, true, false, 'div.entry-content'); diff --git a/custom/manifest.json b/custom/manifest.json index e041f4f..7fc681d 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.2.5.3" + "version": "3.2.5.4" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 9923466..a2fc3d8 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -50,6 +50,12 @@ "domain": "bt.no", "useragent": "facebookbot" }, + "Businessam.be": { + "add_ext_link": "div.paywall|div.entry-content", + "add_ext_link_type": "archive.is", + "allow_cookies": 1, + "domain": "businessam.be" + }, "Businessnews.com.au": { "allow_cookies": 1, "domain": "businessnews.com.au", @@ -496,6 +502,11 @@ "domain": "thestage.co.uk", "ld_google_webcache": "div#ao-MeteringDNAllow|div[id^='aos-FeatureArticle']" }, + "Thetexan.news": { + "allow_cookies": 1, + "domain": "thetexan.news", + "useragent": "googlebot" + }, "Theweek.com": { "allow_cookies": 1, "domain": "theweek.com", diff --git a/manifest.json b/manifest.json index 2fc0f36..d805f92 100644 --- a/manifest.json +++ b/manifest.json @@ -756,5 +756,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.2.5.3" + "version": "3.2.5.4" } diff --git a/sites.js b/sites.js index c880b03..aabd6c5 100644 --- a/sites.js +++ b/sites.js @@ -2560,8 +2560,7 @@ var custom_flex_not = { "###_ca_postmedia": ["canada.com", "canoe.com", "driving.ca"], "###_de_dfv_medien": ["dfv.de"], "###_de_madsack": ["madsack.de", "madsack-medien-campus.de"], - "###_wp_leaky_paywall": ["thewirechina.com"], - "###_medium_custom": ["medium.com"], + "###_wp_leaky_paywall": ["thetexan.news", "thewirechina.com"], "###_uk_axate.io": ["thinkofx.net"], "###_usa_hearst_comm": ["sfgate.com"], "###_usa_mcc": ["mcclatchy.com"], diff --git a/sites_updated.json b/sites_updated.json index 63a2f73..73dbf8b 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -1,4 +1,27 @@ { + "Australian Community Media (daily)": { + "domain": "###_au_comm_media", + "group": [ + "bendigoadvertiser.com.au", + "bordermail.com.au", + "canberratimes.com.au", + "centralwesterndaily.com.au", + "dailyadvertiser.com.au", + "dailyliberal.com.au", + "examiner.com.au", + "illawarramercury.com.au", + "newcastleherald.com.au", + "northerndailyleader.com.au", + "standard.net.au", + "theadvocate.com.au", + "thecourier.com.au", + "westernadvocate.com.au" + ], + "allow_cookies": 1, + "block_regex": "\\.piano\\.io", + "cs_code": "[{\"cond\":\"div[class^=\"gradient-mask-\"]\", \"rm_attrib\": \"class\", \"elems\":[{\"cond\":\"div.hidden\", \"rm_class\": \"hidden\"}]}]", + "upd_version": "3.2.5.3" + }, "Berlingske": { "domain": "berlingske.dk", "allow_cookies": 1, @@ -124,9 +147,9 @@ "Puck.news": { "domain": "puck.news", "allow_cookies": 1, - "ld_google_webcache": "div.paywall|div.entry-content", + "ld_google_webcache": "div[class*=\"paywall\"]|div.entry-content", "cs_code": "[{\"cond\":\"body.paywall-active\", \"rm_class\":\"paywall-active\"},{\"cond\":\"article[style]\", \"rm_attrib\":\"style\"}]", - "upd_version": "3.2.2.7" + "upd_version": "3.2.5.4" }, "Quora (regwall)": { "domain": "quora.com", @@ -166,7 +189,8 @@ "Star Tribune": { "domain": "startribune.com", "remove_cookies_select_drop": ["client_id"], - "upd_version": "3.2.5.2" + "cs_code": "[{\"cond\":\"body:not(.page-article) div.ReactModalPortal\", \"rm_elem\": 1}, {\"cond\":\"body.ReactModal__Body--open\", \"rm_class\": \"ReactModal__Body--open\"}]", + "upd_version": "3.2.5.3" }, "Stuttgarter Nachrichten": { "domain": "stuttgarter-nachrichten.de",