Add elmundo.es (most articles)

This commit is contained in:
Adam 2021-02-25 22:48:41 -08:00
parent 6f652eedf2
commit ef0d40be15
4 changed files with 38 additions and 14 deletions

View File

@ -69,7 +69,8 @@
"*://*.wsj.com/*", "*://*.wsj.com/*",
"*://*.hbr.org/*", "*://*.hbr.org/*",
"*://*.financialpost.com/*", "*://*.financialpost.com/*",
"*://*.sueddeutsche.de/*" "*://*.sueddeutsche.de/*",
"*://*.elmundo.es/*"
], ],
"js": ["src/js/contentScript.js"] "js": ["src/js/contentScript.js"]
} }
@ -266,7 +267,8 @@
"*://*.ambito/*", "*://*.ambito/*",
"*://*.sueddeutsche.de/*", "*://*.sueddeutsche.de/*",
"*://*.spectator.us/*", "*://*.spectator.us/*",
"*://*.humo.be/*" "*://*.humo.be/*",
"*://*.elmundo.es/*"
], ],
"version": "1.7.8" "version": "1.7.8"
} }

View File

@ -73,7 +73,8 @@ const allowCookies = [
'haaretz.com', 'haaretz.com',
'themarker.com', 'themarker.com',
'sueddeutsche.de', 'sueddeutsche.de',
'gelocal.it' 'gelocal.it',
'elmundo.es'
]; ];
// Removes cookies after page load // Removes cookies after page load
@ -237,7 +238,8 @@ const blockedRegexes = {
'thehindu.com': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/.+\/cloudflare-static\/rocket-loader\.min\.js/, 'thehindu.com': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/.+\/cloudflare-static\/rocket-loader\.min\.js/,
'technologyreview.com': /.+\.blueconic\.net\/.+/, 'technologyreview.com': /.+\.blueconic\.net\/.+/,
'spectator.us': /(cdn\.cxense\.com\/.+|\.tinypass\.com\/.+)/, 'spectator.us': /(cdn\.cxense\.com\/.+|\.tinypass\.com\/.+)/,
'gelocal.it': /(\.repstatic\.it\/minify\/sites\/gelocal\/.+\/config\.cache(_\d)?\.php|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/ 'gelocal.it': /(\.repstatic\.it\/minify\/sites\/gelocal\/.+\/config\.cache(_\d)?\.php|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/,
'elmundo.es': /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/
}; };
const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'; const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';

View File

@ -1,4 +1,4 @@
if (!matchDomain(['seekingalpha.com', 'sfchronicle.com', 'cen.acs.org', 'thetimes.co.uk'])) { if (!matchDomain(['seekingalpha.com', 'sfchronicle.com', 'cen.acs.org', 'thetimes.co.uk', 'elmundo.es'])) {
window.localStorage.clear(); window.localStorage.clear();
} }
@ -346,17 +346,16 @@ if (matchDomain('elmercurio.com')) {
}, 500); // Delay (in milliseconds) }, 500); // Delay (in milliseconds)
} else if (matchDomain('elperiodico.com')) { } else if (matchDomain('elperiodico.com')) {
setTimeout(function () { setTimeout(function () {
const unavailableArea = document.querySelector(".closed"); const unavailableArea = document.querySelector('.closed');
const infoBox = document.querySelector(".ep-masPeriodico-info"); const infoBox = document.querySelector('.ep-masPeriodico-info');
if (unavailableArea) { if (unavailableArea) {
unavailableArea.classList.remove("closed"); unavailableArea.classList.remove('closed');
} }
if (infoBox) { if (infoBox) {
infoBox.parentNode.removeChild(infoBox); infoBox.parentNode.removeChild(infoBox);
} }
}, 2000); }, 1000);
} } else if (matchDomain('techinasia.com')) {
else if (matchDomain('techinasia.com')) {
const paywall = document.querySelector('.paywall-content'); const paywall = document.querySelector('.paywall-content');
if (paywall) { if (paywall) {
paywall.classList.remove('paywall-content'); paywall.classList.remove('paywall-content');
@ -480,7 +479,7 @@ if (matchDomain('elmercurio.com')) {
.forEach(function (el) { .forEach(function (el) {
el.removeAttribute('class'); el.removeAttribute('class');
}); });
}, 2000); // Delay (in milliseconds) }, 1000); // Delay (in milliseconds)
} else if (matchDomain('theatlantic.com')) { } else if (matchDomain('theatlantic.com')) {
// Remove all nudge elements // Remove all nudge elements
document.querySelectorAll('div[class*="c-nudge"]').forEach(function (el) { document.querySelectorAll('div[class*="c-nudge"]').forEach(function (el) {
@ -572,6 +571,26 @@ if (matchDomain('elmercurio.com')) {
const ampAds = document.querySelectorAll('amp-ad'); const ampAds = document.querySelectorAll('amp-ad');
removeDOMElement(...ampAds); removeDOMElement(...ampAds);
} }
} else if (matchDomain('elmundo.es')) {
const premium = document.querySelector('.ue-c-article__premium');
const url = window.location.href;
if (!url.includes('/amp.' + 'elmundo.es' + '/')) {
if (premium) {
removeDOMElement(premium);
window.location.href = window.location.href.replace('/www.', '/amp.');
}
} else {
const paywall = document.querySelector('div[amp-access="authorized!=true"]');
if (paywall) {
removeDOMElement(paywall);
const divHidden = document.querySelector('div[amp-access="authorized=true"]');
if (divHidden) {
divHidden.removeAttribute('amp-access-hide');
}
}
const advertising = document.querySelectorAll('.advertising, amp-embed');
removeDOMElement(...advertising);
}
} }
function matchDomain (domains) { function matchDomain (domains) {

View File

@ -31,7 +31,8 @@ const defaultSites = {
'Domani': 'editorialedomani.it', 'Domani': 'editorialedomani.it',
'Dynamed Plus': 'dynamed.com', 'Dynamed Plus': 'dynamed.com',
'Eindhovens Dagblad': 'ed.nl', 'Eindhovens Dagblad': 'ed.nl',
'El Mercurio':'elmercurio.com', 'El Mercurio': 'elmercurio.com',
'El Mundo': 'elmundo.es',
'El Pais': 'elpais.com', 'El Pais': 'elpais.com',
'El Periodico': 'elperiodico.com', 'El Periodico': 'elperiodico.com',
'Elu24': 'elu24.ee', 'Elu24': 'elu24.ee',