From 7f4cb35682f12fdd5708d00cafed69770ae7015a Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sun, 24 Oct 2021 19:01:36 +0200 Subject: [PATCH] Add Elle.fr --- README.md | 1 + background.js | 2 ++ changelog.txt | 1 + contentScript.js | 17 +++++++++++------ custom/manifest.json | 2 +- manifest.json | 3 ++- sites.js | 1 + 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a047fdb..6d4a3a4 100755 --- a/README.md +++ b/README.md @@ -317,6 +317,7 @@ Grouped in options:\ [Atlantico](https://atlantico.fr) - [Challenges](https://www.challenges.fr) - [Charlie Hebdo](https://charliehebdo.fr) - +[Elle](https://www.elle.fr) - [Esprit](https://esprit.presse.fr) - [L'Express](https://www.lexpress.fr) - [L'Obs](https://www.nouvelobs.com) - diff --git a/background.js b/background.js index 1f26e4d..d70cd62 100755 --- a/background.js +++ b/background.js @@ -71,6 +71,7 @@ var allow_cookies_default = [ 'elcomercio.pe', 'elconfidencial.com', 'elespanol.com', + 'elle.fr', 'elmercurio.com', 'elpais.com', 'elperiodico.com', @@ -313,6 +314,7 @@ var blockedRegexes = { 'elcomercio.pe': /\/elcomercio\.pe\/pf\/dist\/engine\/react\.js/, 'elconfidencial.com': /\.tinypass\.com\//, 'elespanol.com': /\.eestatic\.com\/assets_js\/web\/v\d\/historia.*\.min\.js/, + 'elle.fr': /\.poool\.fr\//, 'elmercurio.com': /\.(elmercurio\.com|emol\.cl)\/(.+\/)?js\/(.+\/)?(modal|merPramV\d|PramModal\.min)\.js/, 'elpais.com': /(\.epimg\.net\/js\/.+\/(noticia|user)\.min\.js|\/elpais\.com\/arc\/subs\/p\.min\.js|cdn\.ampproject\.org\/v\d\/amp-(access|(sticky-)?ad|consent)-.+\.js)/, 'elperiodico.com': /cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js/, diff --git a/changelog.txt b/changelog.txt index 93527ab..6fdfe5c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Add Elle.fr Add Marianne (France) Remove Irish Times (obsolete) Remove Sueddeutsche Zeitung (obsolete) diff --git a/contentScript.js b/contentScript.js index f212b80..e12c06b 100755 --- a/contentScript.js +++ b/contentScript.js @@ -833,6 +833,14 @@ else if (matchDomain('charliehebdo.fr')) { }, 500); // Delay (in milliseconds) } +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); +} + else if (matchDomain('esprit.presse.fr')) { let paywall = document.querySelector('.panel-popup-paywall'); removeDOMElement(paywall); @@ -1922,13 +1930,10 @@ else if (matchDomain('foreignaffairs.com')) { let article_dropcap = document.querySelectorAll('.article-dropcap'); for (let elem of article_dropcap) elem.classList.add('loaded'); - let hidden_images = document.querySelectorAll('img[src^="data:image/"]'); + let hidden_images = document.querySelectorAll('img[src^="data:image/"][data-src]'); for (let hidden_image of hidden_images) { - let data_src = hidden_image.getAttribute('data-src'); - if (data_src) { - hidden_image.setAttribute('src', data_src); - hidden_image.removeAttribute('class'); - } + hidden_image.setAttribute('src', hidden_image.getAttribute('data-src')); + hidden_image.removeAttribute('class'); } let img_list = document.querySelectorAll('.magazine-list-article img'); for (let img_elem of img_list) diff --git a/custom/manifest.json b/custom/manifest.json index 68a6b1d..4d67ab2 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -39,5 +39,5 @@ "webRequestBlocking", "" ], - "version": "2.4.0.6" + "version": "2.4.0.7" } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 5814518..aca50ed 100755 --- a/manifest.json +++ b/manifest.json @@ -151,6 +151,7 @@ "*://*.eldiario.es/*", "*://*.eldiariomontanes.es/*", "*://*.elespanol.com/*", + "*://*.elle.fr/*", "*://*.elmercurio.com/*", "*://*.elmundo.es/*", "*://*.elnortedecastilla.es/*", @@ -543,5 +544,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.4.0.6" + "version": "2.4.0.7" } \ No newline at end of file diff --git a/sites.js b/sites.js index 02bf9ac..435659e 100755 --- a/sites.js +++ b/sites.js @@ -63,6 +63,7 @@ var defaultSites = "El Mundo": "elmundo.es", "El País": "elpais.com", "El Periódico (de Catalunya)": "elperiodico.com", + "Elle.fr": "elle.fr", "Encyclopedia Britannica": "britannica.com", "Entrepreneur": "entrepreneur.com", "Esprit": "esprit.presse.fr",