From c4cd2a3cfb291b4eadbd3ce6b453f8209ff992d2 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 16 Dec 2020 18:38:05 +0100 Subject: [PATCH] Fix-update Foreign Affairs --- background.js | 3 ++- changelog.txt | 1 + contentScript.js | 17 +++++++++++++++++ manifest.json | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index e2273e9..c3af18f 100644 --- a/background.js +++ b/background.js @@ -17,6 +17,7 @@ const restrictions = { 'bloombergquint.com': /^((?!\.bloombergquint\.com\/bq-blue-exclusive\/).)*$/, 'elcomercio.pe': /.+\/elcomercio\.pe\/.+((\w)+(\-)+){3,}.+/, 'faz.net': /^((?!\/zeitung\.faz\.net\/).)*$/, + 'foreignaffairs.com': /.+\.foreignaffairs\.com\/(articles|fa-caching|interviews|reviews|sites)\/.+/, 'ft.com': /.+\.ft.com\/content\//, 'gestion.pe': /.+\/gestion\.pe\/.+((\w)+(\-)+){3,}.+/, 'hs.fi': /^((?!\/.+\.hs\.fi\/paivanlehti\/).)*$/, @@ -207,7 +208,7 @@ var blockedRegexes = { 'exame.abril.com.br': /cdn\.tinypass\.com\/.+/, 'financialpost.com': /cdn\.tinypass\.com\/.+/, 'folha.uol.com.br': /(.+\.folha\.uol\.com\.br\/paywall\/js\/.+\/publicidade\.ads\.js|paywall\.folha\.uol\.com\.br\/.+|js\.matheranalytics\.com\/.+)/, - 'foreignaffairs.com': /.+\.foreignaffairs\.com\/sites\/default\/files\/js\/js_P9zr.+\.js/, + 'foreignaffairs.com': /.+\.foreignaffairs\.com\/sites\/default\/files\/js\/js_[^y].+\.js/, 'foreignpolicy.com': /cdn\.tinypass\.com\/.+/, 'fortune.com': /cdn\.tinypass\.com\/.+/, 'fresnobee.com': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/, diff --git a/changelog.txt b/changelog.txt index 23bd71c..cdd6d16 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix-update Foreign Affairs Fix-update Tech in Asia (homepage) Fix show update (amo-version) diff --git a/contentScript.js b/contentScript.js index 17163dd..1c811ab 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1462,6 +1462,23 @@ 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/"]'); + for (let hidden_image of hidden_images) { + var data_src = hidden_image.getAttribute("data-src"); + if (data_src) { + hidden_image.setAttribute('src', data_src); + hidden_image.removeAttribute('class'); + } + } + if (window.location.href.includes('/interviews/')) { + let img_header = document.querySelector('.interview-header > div'); + if (img_header) { + let img_src = img_header.getAttribute("data-src"); + let img_elem = document.createElement('img'); + img_elem.src = img_src; + img_header.appendChild(img_elem); + } + } } else if (matchDomain("kurier.at")) { diff --git a/manifest.json b/manifest.json index 391697c..07271af 100644 --- a/manifest.json +++ b/manifest.json @@ -408,5 +408,5 @@ "*://*.repstatic.it/*", "*://*.userzoom.com/*" ], - "version": "1.9.9.1" + "version": "1.9.9.2" } \ No newline at end of file