From 3adcc0e4fd36ad93929cfbcf00fcf7c2443c28a4 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Thu, 9 Dec 2021 21:32:27 +0100 Subject: [PATCH] Fix ABC.es (amp) --- changelog.txt | 1 + contentScript.js | 10 +++++++++- sites.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 514c7429..a8cad871 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Koelner Stadt-Anzeiger & Koelnische Rundschau Add The (New Orleans) Advocate +Fix ABC.es (amp) Fix Funke Mediengruppe (amp) Fix Lecho.be (separate from Groupe Rossel) Fix Repubblica sites (no amp) diff --git a/contentScript.js b/contentScript.js index 5a185f6f..132788e4 100644 --- a/contentScript.js +++ b/contentScript.js @@ -648,7 +648,15 @@ else } else if (window.location.hostname.match(/\.(es|pt)$/) || matchDomain(['diariovasco.com', 'elconfidencial.com', 'elcorreo.com', 'elespanol.com', 'elpais.com', 'elperiodico.com', 'elperiodicomediterraneo.com', 'expansion.com', 'larioja.com', 'lavanguardia.com', 'levante-emv.com', 'marca.com', 'politicaexterior.com'])) {//spain/portugal -if (matchDomain('cmjornal.pt')) { +if (matchDomain('abc.es')) { + if (window.location.pathname.endsWith('_amp.html')) { + amp_unhide_access_hide('="result=\'ALLOW_ACCESS\'"', '', 'amp-ad, amp-embed'); + premium_banner = document.querySelector('.cierre-suscripcion'); + removeDOMElement(premium_banner); + } +} + +else if (matchDomain('cmjornal.pt')) { let paywall = document.querySelector('.bloqueio_exclusivos'); let amphtml = document.querySelector('link[rel="amphtml"]'); let url = window.location.href; diff --git a/sites.js b/sites.js index 2af97999..8ca2e03f 100644 --- a/sites.js +++ b/sites.js @@ -11,7 +11,7 @@ var defaultSites = { "ABC.es": { domain: "abc.es", allow_cookies: 1, - block_regex: /\.evolok\.net\//, + block_regex: /(\.evolok\.net\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|consent)-.+\.js)/, useragent: "googlebot" }, "Advance Local": {