diff --git a/background.js b/background.js index da4bc37..6a95ed0 100644 --- a/background.js +++ b/background.js @@ -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 }; diff --git a/contentScript.js b/contentScript.js index d815c4d..8f3e7c6 100644 --- a/contentScript.js +++ b/contentScript.js @@ -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) {