Fix-update Challenges.fr

Firefox-specific fix (blocks domain-Javascript).
Reactions aren't visible anymore (for non-premium articles you can disable site in options).
This commit is contained in:
magnolia1234 2020-03-30 19:59:29 +02:00 committed by GitHub
parent 7865a98760
commit d81aa3d3d7
2 changed files with 20 additions and 3 deletions

View File

@ -133,7 +133,7 @@ var blockedRegexes = {
'bloomberg.com': /.+\.tinypass\.com\/.+/,
'bostonglobe.com': /meter\.bostonglobe\.com\/js\/.+/,
'businessinsider.com': /(.+\.tinypass\.com\/.+|cdn\.onesignal\.com\/sdks\/.+\.js)/,
'challenges.fr': /.+\.poool\.fr\/.+/,
'challenges.fr': /(.+\.challenges\.fr\/js\/|.+\.poool\.fr\/.+)/,
'chicagobusiness.com': /.+\.tinypass\.com\/.+/,
'chicagotribune.com': /.+:\/\/.+\.tribdss\.com\//,
'corriere.it': /(\.rcsobjects\.it\/rcs_cpmt\/|\.rcsobjects\.it\/rcs_tracking-service\/|\.corriereobjects\.it\/.+\/js\/_paywall\.sjs|\.corriereobjects\.it\/.*\/js\/tracking\/|\.userzoom\.com\/files\/js\/|\.lp4\.io\/app\/)/,
@ -379,10 +379,13 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
// allow BG paywall-script to set cookies in homepage/sections (else no article-text)
if (details.url.indexOf('meter.bostonglobe.com/js/') !== -1 && (header_referer === 'https://www.bostonglobe.com/'
|| header_referer.indexOf('/?p1=BGHeader_') !== -1 || header_referer.indexOf('/?p1=BGMenu_') !== -1)) {
ext_api.webRequest.handlerBehaviorChanged(function () {});
ext_api.webRequest.handlerBehaviorChanged();
break;
} else if (header_referer.indexOf('theglobeandmail.com') !== -1 && !(header_referer.indexOf('/article-') !== -1)) {
ext_api.webRequest.handlerBehaviorChanged(function () {});
ext_api.webRequest.handlerBehaviorChanged();
break;
} else if (header_referer.indexOf('challenges.fr') !== -1 && (!(header_referer.indexOf('_') !== -1) || (header_referer.indexOf('/videos/') !== -1))) {
ext_api.webRequest.handlerBehaviorChanged();
break;
}
return { cancel: true };

View File

@ -475,6 +475,20 @@ else if (matchDomain('ladepeche.fr')) {
});
}
else if (matchDomain('challenges.fr')) {
document.addEventListener('DOMContentLoaded', () => {
const hidden_image = document.querySelectorAll('img.lazyload');
for (let i = 0; i < hidden_image.length; i++) {
var src = hidden_image[i].src;
if (src.includes("/placeholders/") || src === '') {
var data_src = hidden_image[i].getAttribute("data-src");
if (data_src)
hidden_image[i].setAttribute('src', data_src);
}
}
});
}
// General Functions
function removeDOMElement(...elements) {
for (let element of elements) {