From e2ff4d03a8c450f3a663db05cd795ea66d668f03 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Tue, 2 Aug 2022 23:39:41 +0200 Subject: [PATCH] Fix The Athletic (amp) --- changelog.txt | 1 + contentScript.js | 3 ++- manifest.json | 2 +- sites.js | 4 ++-- sites_updated.json | 13 +++++++++++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index eeeb1b58..6dfef873 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Add Limburger.nl Add Standaard.be Add SuomenSotilas.fi Add Tagesspiegel.de +Fix The Athletic (amp) Redirect Google AMP cache (opt-in to custom sites) Update block general paywall script (limit Evolok WordPress) Update custom sites (load text from Google webcache) diff --git a/contentScript.js b/contentScript.js index a37c07d1..310f675a 100644 --- a/contentScript.js +++ b/contentScript.js @@ -3675,10 +3675,11 @@ else if (matchDomain('theathletic.com')) { removeDOMElement(...paywall); window.setTimeout(function () { window.location.href = amphtml.href; - }, 500); + }, 1000); } } else { amp_unhide_subscr_section(); + amp_unhide_access_hide('', '*="NOT granted"'); let subscr_actions = document.querySelectorAll('[subscriptions-actions]'); removeDOMElement(...subscr_actions); let layout_fail = document.querySelectorAll('.col-sm-12'); diff --git a/manifest.json b/manifest.json index d6d5b3a5..87adb71a 100644 --- a/manifest.json +++ b/manifest.json @@ -700,5 +700,5 @@ "*://gcm.omerlocdn.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "2.7.8.3" + "version": "2.7.8.4" } diff --git a/sites.js b/sites.js index ebed93ac..636d7f26 100644 --- a/sites.js +++ b/sites.js @@ -1654,7 +1654,7 @@ var defaultSites = { "theathletic.com" ], allow_cookies: 1, - block_regex: /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/ + block_regex: /cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js/ }, "The Atlanta Journal-Constitution": { domain: "ajc.com", @@ -2210,4 +2210,4 @@ var no_nhst_media_domains = grouped_sites['###_no_nhst_media']; // sites with no fix (background) var nl_ad_region_domains = ['ad.nl', 'bd.nl', 'ed.nl', 'tubantia.nl', 'bndestem.nl', 'pzc.nl', 'destentor.nl', 'gelderlander.nl']; -var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'cnbc.com', 'courrierinternational.com', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'gazzetta.it', 'handelsblatt.com', 'hln.be', 'ilmanifesto.it', 'ilsole24ore.com', 'jacobinmag.com', 'jeunesafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'liberation.fr', 'mediapart.fr', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nieuwsblad.be', 'nknews.org', 'ouest-france.fr', 'politiken.de', 'publico.pt', 'republic.ru', 'rp-online.de', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'welt.de', 'wiwo.de', 'ynet.co.il'].concat(nl_ad_region_domains); +var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'cnbc.com', 'courrierinternational.com', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'gazzetta.it', 'handelsblatt.com', 'hln.be', 'ilmanifesto.it', 'ilsole24ore.com', 'jacobinmag.com', 'jeunesafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'liberation.fr', 'mediapart.fr', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nieuwsblad.be', 'nknews.org', 'ouest-france.fr', 'politiken.dk', 'publico.pt', 'republic.ru', 'rp-online.de', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'welt.de', 'wiwo.de', 'ynet.co.il'].concat(nl_ad_region_domains); diff --git a/sites_updated.json b/sites_updated.json index 7a70f76a..8979cdf6 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -82,6 +82,19 @@ } ] }, + "The Athletic": { + "domain": "###_usa_theathletic", + "group": [ + "theathletic.com" + ], + "allow_cookies": 1, + "block_regex": "cdn\\.ampproject\\.org\\/v\\d\\/amp-(access|subscriptions)-.+\\.js", + "cs_code": [{ + "cond": "div[amp-access*=\"NOT granted\"]", + "rm_elem": 1 + } + ] + }, "Winnipeg Free Press": { "domain": "winnipegfreepress.com", "allow_cookies": 1,