Add El Periódico (Spain)

This commit is contained in:
magnolia1234 2020-11-23 18:12:40 +01:00
parent 3f6f161d3f
commit cf40936a9f
6 changed files with 35 additions and 4 deletions

View file

@ -244,7 +244,8 @@ Visit the [Chrome repository](https://gitlab.com/magnolia1234/bypass-paywalls-ch
[La Verdad](https://www.laverdad.es) -
[Sur](https://www.diariosur.es)
[El Mundo](https://www.elmundo.es) -
[El País](https://elpais.com)
[El País](https://elpais.com) -
[El Periódico](https://www.elperiodico.com)
##### Sweden
[Aftonbladet](https://www.aftonbladet.se) -

View file

@ -39,6 +39,7 @@ var allow_cookies_default = [
'elmercurio.com',
'elmundo.es',
'elpais.com',
'elperiodico.com',
'eurekareport.com.au',
'faz.net',
'financialpost.com',
@ -192,6 +193,7 @@ var blockedRegexes = {
'elmercurio.com': /(elmercurio\.com\/.+\/js\/modal\.js|merreader\.emol\.cl\/assets\/js\/(vendor\/modal|merPramV\d)\.js|staticmer(\d)?\.emol\.cl\/js\/.+\/(modal|PramModal\.min)\.js)/,
'elmundo.es': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/,
'elpais.com': /.+\.epimg\.net\/js\/.+\/noticia\.min\.js/,
'elperiodico.com': /cdn\.ampproject\.org\/v\d\/amp-(access|consent)-.+\.js/,
'estadao.com.br': /acesso\.estadao\.com\.br\/paywall\/.+\/pw\.js/,
'estrellavalpo.cl': /(.+\.mercuriovalpo\.cl\/impresa\/.+\/assets\/(vendor|\d)\.js|pram\.pasedigital\.cl\/API\/User\/Status\?)/,
'exame.abril.com.br': /cdn\.tinypass\.com\/.+/,
@ -686,6 +688,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
let au_swm_site = (header_referer && urlHost(header_referer).endsWith('com.au') && details.url.includes('https://s.thewest.com.au/'));
let es_grupo_vocento_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(es_grupo_vocento_domains, header_referer) && isSiteEnabled({url: header_referer}));
let sz_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain('sueddeutsche.de', header_referer) && isSiteEnabled({url: header_referer}));
if (!isSiteEnabled(details) && !inkl_site && !bloomberg_site && !au_nc_amp_site && !au_apn_site && !au_swm_site && !es_grupo_vocento_site && !sz_amp_site) {
return;
}
@ -768,7 +771,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
if (tabId !== -1) {
ext_api.tabs.get(tabId, function (currentTab) {
if ((currentTab && isSiteEnabled(currentTab)) || medium_custom_domain || au_apn_site || au_swm_site || es_grupo_vocento_site || sz_amp_site) {
if ((currentTab && isSiteEnabled(currentTab)) || medium_custom_domain || au_apn_site || au_swm_site) {
ext_api.tabs.executeScript(tabId, {
file: 'contentScript.js',
runAt: 'document_start'

View file

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Firefox
Post-release
Add El Periodico (Spain)
Add Grupo Vocento (Spain, regional daily)
Fix-update Corriere Della Sera (redirect preview)
Update block general paywall script (Pelcro)

View file

@ -1111,6 +1111,9 @@ else if (matchDomain("sueddeutsche.de")) {
let paragraph_hidden = document.querySelectorAll('.paragraph--hidden');
for (let par_hidden of paragraph_hidden)
par_hidden.classList.remove('paragraph--hidden');
let paragraph_dynamic = document.querySelector('.paragraph--dynamic');
if (paragraph_dynamic)
paragraph_dynamic.classList.remove('paragraph--dynamic');
let amp_offerpage = document.querySelector('.amp-offerpage');
removeDOMElement(amp_offerpage);
}
@ -1666,6 +1669,27 @@ else if (matchDomain("corriere.it")) {
}
}
else if (matchDomain("elperiodico.com")) {
let url = window.location.href;
if (!url.includes('amp.elperiodico.com')) {
let paywall = document.querySelector('.ep-masPeriodico-info-login');
if (paywall) {
window.setTimeout(function () {
window.location.href = url.replace('www.', 'amp.');
}, 500); // Delay (in milliseconds)
}
} else {
let not_logged = document.querySelector('.ep-masPeriodico-info-login');
if (not_logged) {
let non_subscr_section = document.querySelector('div[amp-access="NOT logged"]');
removeDOMElement(not_logged, non_subscr_section);
let subscr_section = document.querySelector('div[amp-access="logged"]');
if (subscr_section)
subscr_section.removeAttribute('amp-access-hide');
}
}
}
// General Functions
function removeDOMElement(...elements) {
for (let element of elements) {

View file

@ -114,6 +114,7 @@
"*://*.elmundo.es/*",
"*://*.elnortedecastilla.es/*",
"*://*.elpais.com/*",
"*://*.elperiodico.com/*",
"*://*.estadao.com.br/*",
"*://*.estrellavalpo.cl/*",
"*://*.eurekareport.com.au/*",
@ -328,6 +329,7 @@
"*://*.blueconic.net/*",
"*://*.matheranalytics.com/*",
"*://*.onecount.net/*",
"*://*.pelcro.com/*",
"*://*.piano.io/*",
"*://*.poool.fr/*",
"*://*.qiota.com/*",
@ -350,10 +352,9 @@
"*://*.mppglobal.com/*",
"*://*.nyt.com/*",
"*://*.pasedigital.cl/*",
"*://*.pelcro.com/*",
"*://*.rcsobjects.it/*",
"*://*.repstatic.it/*",
"*://*.userzoom.com/*"
],
"version": "1.9.6.3"
"version": "1.9.6.4"
}

View file

@ -48,6 +48,7 @@ var defaultSites =
"El Mercurio de Valparaíso": "mercuriovalpo.cl",
"El Mundo": "elmundo.es",
"El País": "elpais.com",
"El Periódico": "elperiodico.com",
"Encyclopedia Britannica": "britannica.com",
"Eureka Report": "eurekareport.com.au",
"Exame": "exame.abril.com.br",