From 77e0c3ba7fc022a483dd28baefe464962065a2eb Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 30 Apr 2021 17:25:41 +0200 Subject: [PATCH] Add L'Oeil de la Photographie (fr/en) --- README.md | 1 + background.js | 2 + changelog.txt | 1 + contentScript.js | 101 ++++++++++++++++++++++++++--------------------- manifest.json | 3 +- sites.js | 1 + 6 files changed, 64 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 517753d1..31485b8c 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,7 @@ Alma Talent sites (grouped in options) like [Esprit](https://esprit.presse.fr) - [L'Express](https://www.lexpress.fr) - [L'Obs](https://www.nouvelobs.com) - +[L'Oeil de la Photographie (fr/en)](https://loeildelaphotographie.com) - [L'Opinion](https://www.lopinion.fr) - [L'Usine Nouvelle](https://www.usinenouvelle.com) - [La Croix](https://www.la-croix.com) - diff --git a/background.js b/background.js index 7d7758c2..fbb40f1b 100644 --- a/background.js +++ b/background.js @@ -99,6 +99,7 @@ var allow_cookies_default = [ 'letelegramme.fr', 'lexpress.fr', 'lne.es', + 'loeildelaphotographie.com', 'lrb.co.uk', 'marketwatch.com', 'medium.com', @@ -334,6 +335,7 @@ var blockedRegexes = { 'lexpress.fr': /\.poool\.fr\//, 'livemint.com': /(\.livemint\.com\/js\/localWorker\.js|analytics\.htmedia\.in\/analytics-js\/.+\.js)/, 'lne.es': /cdn\.ampproject\.org\/v\d\/amp-(access|consent)-.+\.js/, + 'loeildelaphotographie.com': /cdn\.loeildelaphotographie\.com\/wp-content\/.+\/hague-child\/js\/script-.+\.js/, 'lopinion.fr': /\.poool\.fr\//, 'lrb.co.uk': /\.tinypass\.com\//, 'marketwatch.com': /(cdn\.cxense\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad)-.+\.js)/, diff --git a/changelog.txt b/changelog.txt index 2ba2beb7..74e974b2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Levante-EMV (Spain) +Add L'Oeil de la Photographie (fr/en) Add The New Atlantis Update custom sites (optional: only permissions for added sites) diff --git a/contentScript.js b/contentScript.js index bb0883e5..ce023a7a 100644 --- a/contentScript.js +++ b/contentScript.js @@ -754,7 +754,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', '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', 'nouvelobs.com', 'parismatch.com'])) {//france if (matchDomain('alternatives-economiques.fr')) { window.setTimeout(function () { @@ -772,6 +772,17 @@ else if (matchDomain('atlantico.fr')) { paywall.classList.remove('dpslvp'); } +else if (matchDomain('challenges.fr')) { + let amorce = document.querySelector('.user-paying-amorce'); + if (amorce) + amorce.setAttribute('style', 'display:none !important'); + let content = document.querySelector('.user-paying-content'); + if (content) + content.setAttribute('style', 'display: block !important'); + let paywall = document.querySelector('.temp-paywall'); + removeDOMElement(paywall); +} + else if (matchDomain('charliehebdo.fr')) { window.setTimeout(function () { let paywalled_content = document.querySelector('div.ch-paywalled-content'); @@ -809,6 +820,24 @@ else if ((domain = matchDomain(fr_groupe_ebra_domains)) && window.location.href. } } +else if (domain = matchDomain(fr_groupe_la_depeche_domains)) { + let url = window.location.href; + let url_new = url.replace(domain + '/', domain + '/amp/'); + if (url.includes(domain + '/amp/')) { + let subscr_section = document.querySelectorAll('[subscriptions-section="content"]'); + for (let elem of subscr_section) + elem.removeAttribute('subscriptions-section'); + let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); + removeDOMElement(...amp_ads); + } else { + let paywall = document.querySelector('div.paywall'); + if (paywall) { + removeDOMElement(paywall); + window.location.href = url_new; + } + } +} + else if (matchDomain('journaldunet.com')) { let reg_wall = document.querySelector('.reg_wall'); removeDOMElement(reg_wall); @@ -818,17 +847,6 @@ else if (matchDomain('journaldunet.com')) { } } -else if (matchDomain(['lejdd.fr', 'parismatch.com'])) { - let poool_banner = document.querySelector('#poool-container'); - let forbidden = document.querySelector('.forbidden'); - removeDOMElement(poool_banner, forbidden); - let bottom_hide = document.querySelector('.cnt[data-poool-mode="hide"]'); - if (bottom_hide) { - bottom_hide.removeAttribute('data-poool-mode'); - bottom_hide.removeAttribute('style'); - } -} - else if (matchDomain('la-croix.com')) { let url = window.location.href; if (!url.includes('la-croix.com/amp/')) { @@ -846,46 +864,28 @@ else if (matchDomain('la-croix.com')) { } } +else if (matchDomain('lanouvellerepublique.fr')) { + let alert_didacticiel = document.querySelector('div.alert-didacticiel'); + let loading = document.querySelectorAll('span.loading'); + removeDOMElement(alert_didacticiel, ...loading); +} + else if (matchDomain('ledevoir.com')) { let counter = document.querySelector('.popup-msg'); removeDOMElement(counter); } -else if (domain = matchDomain(fr_groupe_la_depeche_domains)) { - let url = window.location.href; - let url_new = url.replace(domain + '/', domain + '/amp/'); - if (url.includes(domain + '/amp/')) { - let subscr_section = document.querySelectorAll('[subscriptions-section="content"]'); - for (let elem of subscr_section) - elem.removeAttribute('subscriptions-section'); - let amp_ads = document.querySelectorAll('amp-ad, amp-embed'); - removeDOMElement(...amp_ads); - } else { - let paywall = document.querySelector('div.paywall'); - if (paywall) { - removeDOMElement(paywall); - window.location.href = url_new; - } +else if (matchDomain(['lejdd.fr', 'parismatch.com'])) { + let poool_banner = document.querySelector('#poool-container'); + let forbidden = document.querySelector('.forbidden'); + removeDOMElement(poool_banner, forbidden); + let bottom_hide = document.querySelector('.cnt[data-poool-mode="hide"]'); + if (bottom_hide) { + bottom_hide.removeAttribute('data-poool-mode'); + bottom_hide.removeAttribute('style'); } } -else if (matchDomain('challenges.fr')) { - let amorce = document.querySelector('.user-paying-amorce'); - if (amorce) - amorce.setAttribute('style', 'display:none !important'); - let content = document.querySelector('.user-paying-content'); - if (content) - content.setAttribute('style', 'display: block !important'); - let paywall = document.querySelector('.temp-paywall'); - removeDOMElement(paywall); -} - -else if (matchDomain('lanouvellerepublique.fr')) { - let alert_didacticiel = document.querySelector('div.alert-didacticiel'); - let loading = document.querySelectorAll('span.loading'); - removeDOMElement(alert_didacticiel, ...loading); -} - else if (matchDomain('lesechos.fr') && window.location.href.match(/-\d{6,}/)) { window.setTimeout(function () { let abo_banner = document.querySelector('[class^="pgxf3b"]'); @@ -941,6 +941,19 @@ else if (matchDomain('liberation.fr')) { close_button.click(); } +else if (matchDomain('loeildelaphotographie.com')) { + let paywall = document.querySelector('.paywall'); + if (paywall) { + paywall.removeAttribute('class'); + } + let premium_pic_boxes = document.querySelectorAll('.premium-pic-box'); + let banners = document.querySelectorAll('.membership-promo-container, .login_form_litle'); + removeDOMElement(...premium_pic_boxes, ...banners); + let blurred_images = document.querySelectorAll('img[style*="blur"]'); + for (let blurred_image of blurred_images) + blurred_image.removeAttribute('style'); +} + else if (matchDomain('nouvelobs.com')) { let paywall = document.querySelector('.paywall'); removeDOMElement(paywall); diff --git a/manifest.json b/manifest.json index 32c58eac..b384e4dd 100644 --- a/manifest.json +++ b/manifest.json @@ -271,6 +271,7 @@ "*://*.ln-online.de/*", "*://*.lne.es/*", "*://*.loebclassics.com/*", + "*://*.loeildelaphotographie.com/*", "*://*.lopinion.fr/*", "*://*.lorientlejour.com/*", "*://*.lrb.co.uk/*", @@ -504,5 +505,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.1.8.3" + "version": "2.1.8.4" } \ No newline at end of file diff --git a/sites.js b/sites.js index 30d43032..580369c5 100644 --- a/sites.js +++ b/sites.js @@ -121,6 +121,7 @@ var defaultSites = "Kurier.at": "kurier.at", "L'Express": "lexpress.fr", "L'Obs": "nouvelobs.com", + "L'Oeil de la Photographie": "loeildelaphotographie.com", "L'Opinion": "lopinion.fr", "L'Orient-Le Jour": "lorientlejour.com", "L'Usine Nouvelle": "usinenouvelle.com",