diff --git a/changelog.txt b/changelog.txt index daf2d6e..6ffe8c5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -8,18 +8,22 @@ Remove Caixin Global (obsolete) Fix ABC.es (amp) Fix Artnet (amp) Fix Billboard (amp) +Fix Challenges.fr (amp) Fix Digiday (amp) +Fix Elle.fr (amp) Fix ET Prime (amp) Fix Fortune (amp) Fix Bloomberg Quint (bq blue) Fix Funke Mediengruppe (amp) Fix Inkl (images) +Fix L'Opinion.fr (amp) Fix Lecho.be (separate from Groupe Rossel) Fix Lee Enterprises Group (amp) Fix LiveMint (amp) Fix Los Angeles Times & San Diego Union-Tribune (amp) Fix Newsday (amp) Fix Repubblica sites (no amp) +Fix Science & Vie (amp) Fix The Boston Globe (amp) Fix The Dallas Morning News (amp) Fix USA Today & Gannett Group (amp) diff --git a/contentScript.js b/contentScript.js index 7200265..63bbecc 100644 --- a/contentScript.js +++ b/contentScript.js @@ -817,7 +817,7 @@ else if (matchDomain('politicaexterior.com')) { else csDone = true; -} else if (window.location.hostname.endsWith('.fr') || matchDomain(['bienpublic.com', 'journaldunet.com', 'la-croix.com', 'ledauphine.com', 'ledevoir.com', 'lejsl.com', 'loeildelaphotographie.com', 'marianne.net', 'nouvelobs.com', 'parismatch.com'])) {//france +} else if (window.location.hostname.endsWith('.fr') || matchDomain(['bienpublic.com', 'journaldunet.com', 'la-croix.com', 'ledauphine.com', 'ledevoir.com', 'lejsl.com', 'loeildelaphotographie.com', 'marianne.net', 'nouvelobs.com', 'parismatch.com', 'science-et-vie.com'])) {//france if (matchDomain('alternatives-economiques.fr')) { window.setTimeout(function () { @@ -836,14 +836,18 @@ else if (matchDomain('atlantico.fr')) { } else if (matchDomain('challenges.fr')) { - let amorce = document.querySelector('.user-paying-amorce'); - if (amorce) - amorce.setAttribute('style', 'display:none !important'); - let content = document.querySelectorAll('.user-paying-content'); - for (let elem of content) - elem.classList.remove('user-paying-content'); - let paywall = document.querySelector('.temp-paywall'); - removeDOMElement(paywall); + if (window.location.pathname.endsWith('.amp')) { + amp_unhide_access_hide('="paywall.access OR cha.access"', '="NOT (paywall.access OR cha.access)"'); + } else { + let amorce = document.querySelector('.user-paying-amorce'); + if (amorce) + amorce.setAttribute('style', 'display:none !important'); + let content = document.querySelectorAll('.user-paying-content'); + for (let elem of content) + elem.classList.remove('user-paying-content'); + let paywall = document.querySelector('.temp-paywall'); + removeDOMElement(paywall); + } } else if (matchDomain('charliehebdo.fr')) { @@ -857,11 +861,15 @@ else if (matchDomain('charliehebdo.fr')) { } else if (matchDomain('elle.fr')) { - let hidden_images = document.querySelectorAll('img[src^="data:image/"][data-src]'); - for (let hidden_image of hidden_images) - hidden_image.setAttribute('src', hidden_image.getAttribute('data-src')); - let subscription_bar = document.querySelector('.tc-subscription-bar'); - removeDOMElement(subscription_bar); + if (window.location.hostname.startsWith('amp.')) { + amp_unhide_access_hide('="poool.access OR cmi_premium.access"'); + } else { + let hidden_images = document.querySelectorAll('img[src^="data:image/"][data-src]'); + for (let hidden_image of hidden_images) + hidden_image.setAttribute('src', hidden_image.getAttribute('data-src')); + let subscription_bar = document.querySelector('.tc-subscription-bar'); + removeDOMElement(subscription_bar); + } } else if (matchDomain('esprit.presse.fr')) { @@ -1005,6 +1013,11 @@ else if (matchDomain('loeildelaphotographie.com')) { blurred_image.removeAttribute('style'); } +else if (matchDomain('lopinion.fr')) { + if (window.location.search.startsWith('?_amp=true')) + amp_unhide_access_hide('="access"', '="NOT access"'); +} + else if (matchDomain('marianne.net')) { let paywall = document.querySelector('div.paywall'); if (paywall && dompurify_loaded) { @@ -1027,6 +1040,24 @@ else if (matchDomain('nouvelobs.com')) { removeDOMElement(paywall); } +else if (matchDomain('science-et-vie.com')) { + if (window.location.hostname.startsWith('amp.')) { + let pars = document.querySelectorAll('.qiota_reserve > p, .qiota_reserve > h2'); + let pars_text = []; + for (let par of pars) { + if (pars_text.includes(par.innerText)) + removeDOMElement(par); + else + pars_text.push(par.innerText); + } + let sizer = document.querySelector('div.article-content > amp-script > i-amphtml-sizer'); + removeDOMElement(sizer); + let replaced_content = document.querySelector('div.i-amphtml-replaced-content'); + if (replaced_content) + replaced_content.removeAttribute('class'); + } +} + else if (matchDomain('sudouest.fr')) { let url = window.location.href; let paywall = document.querySelector('.article-premium-footer'); diff --git a/manifest.json b/manifest.json index 5003cad..88d26e7 100644 --- a/manifest.json +++ b/manifest.json @@ -586,5 +586,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.4.6.6" + "version": "2.4.6.7" } diff --git a/sites.js b/sites.js index 02de2b6..e8dc8a8 100644 --- a/sites.js +++ b/sites.js @@ -210,7 +210,7 @@ var defaultSites = { }, "Challenges": { domain: "challenges.fr", - block_regex: /\.poool\.fr\// + block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js)/ }, "Charlie Hebdo": { domain: "charliehebdo.fr", @@ -382,7 +382,7 @@ var defaultSites = { "Elle.fr": { domain: "elle.fr", allow_cookies: 1, - block_regex: /\.poool\.fr\// + block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|consent)-.+\.js)/ }, "Encyclopedia Britannica": { domain: "britannica.com" @@ -776,7 +776,7 @@ var defaultSites = { }, "L'Opinion": { domain: "lopinion.fr", - block_regex: /\.poool\.fr\// + block_regex: /(\.poool\.fr\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/ }, "L'Orient-Le Jour": { domain: "lorientlejour.com"