From 908fc8c72385266ef842f9f55be7cb06e095e5d1 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 30 Jan 2021 19:18:00 +0100 Subject: [PATCH] Fix-update El Mercurio (Chile) --- background.js | 5 +++-- changelog.txt | 1 + contentScript.js | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index 05144d2..8d6a2e2 100644 --- a/background.js +++ b/background.js @@ -4,7 +4,7 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; var ext_name = ext_api.runtime.getManifest().name; -const cs_limit_except = ['afr.com', 'discovermagazine.com', 'elcomercio.pe', 'elpais.com', 'faz.net', 'gestion.pe', 'harpers.org', 'inkl.com', 'jpost.com', 'la-croix.com', 'lescienze.it', 'lne.es', 'marketwatch.com', 'newleftreview.org', 'prospectmagazine.co.uk', 'techinasia.com', 'thepointmag.com']; +const cs_limit_except = ['afr.com', 'discovermagazine.com', 'elcomercio.pe', 'elmercurio.com', 'elpais.com', 'faz.net', 'gestion.pe', 'harpers.org', 'inkl.com', 'jpost.com', 'la-croix.com', 'lescienze.it', 'lne.es', 'marketwatch.com', 'newleftreview.org', 'prospectmagazine.co.uk', 'techinasia.com', 'thepointmag.com']; var currentTabUrl = ''; var csDone = false; @@ -835,6 +835,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let au_nc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(au_news_corp_domains, header_referer) && isSiteEnabled({url: header_referer})); let au_apn_site = (header_referer && (urlHost(header_referer).endsWith('com.au') || urlHost(header_referer).endsWith('net.au')) && details.url.includes('https://media.apnarm.net.au/')); let au_swm_site = (header_referer && urlHost(header_referer).endsWith('com.au') && details.url.includes('https://s.thewest.com.au/')); + let cl_elmerc_site = (matchUrlDomain('emol.cl', details.url) && matchUrlDomain('elmercurio.com', header_referer) && isSiteEnabled({url: header_referer})); let uk_nlr_site = (matchUrlDomain('stripe.com', details.url) && matchUrlDomain('newleftreview.org', header_referer) && isSiteEnabled({url: header_referer})); let usa_discmag_site = (matchUrlDomain('ctfassets.net', details.url) && matchUrlDomain('discovermagazine.com', header_referer) && isSiteEnabled({url: header_referer})); let usa_mw_site = (matchUrlDomain('wsj.net', details.url) && matchUrlDomain('marketwatch.com', header_referer) && isSiteEnabled({url: header_referer})); @@ -842,7 +843,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && isSiteEnabled({url: header_referer}) && matchUrlDomain(['barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'fresnobee.com', 'gelocal.it', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'lne.es', 'marketwatch.com', 'nationalreview.com', 'sacbee.com', 'seekingalpha.com', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_nine_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains), header_referer)); - if (!isSiteEnabled(details) && !inkl_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !uk_nlr_site && !usa_discmag_site && !usa_mw_site && !bpc_amp_site) { + if (!isSiteEnabled(details) && !inkl_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !cl_elmerc_site && !uk_nlr_site && !usa_discmag_site && !usa_mw_site && !bpc_amp_site) { return; } diff --git a/changelog.txt b/changelog.txt index 2dbdfb4..0b42ef7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Add Griffith Review (Australia) Add The Hill Times (Canada) Add The Jerusalem Post (Israel) Fix-update Adweek (amp for premium) +Fix-update El Mercurio (Chile) Fix-update El Pais (premium/images) Fix-update Funke Mediengruppe (OTZ & TA) Update custom sites (block Javascript) diff --git a/contentScript.js b/contentScript.js index 6660ba2..7cc0aac 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2000,6 +2000,14 @@ else if (matchDomain('griffithreview.com')) { removeDOMElement(subscribe); } +else if (matchDomain('elmercurio.com')) { + window.setTimeout(function () { + let elem_hidden = document.querySelectorAll('[style="visibility:hidden"]'); + for (let elem of elem_hidden) + elem.removeAttribute('style'); + }, 1000); // Delay (in milliseconds) +} + else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) csDone = true;