diff --git a/background.js b/background.js index 7622570..004b0c5 100755 --- a/background.js +++ b/background.js @@ -34,6 +34,7 @@ var allow_cookies = [ 'dvhn.nl', 'editorialedomani.it', 'elmercurio.com', +'elpais.com', 'mercuriovalpo.cl', 'eurekareport.com.au', 'faz.net', diff --git a/changelog.txt b/changelog.txt index 5a820a4..60ef72d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -10,6 +10,7 @@ Add Westfalenpost Add Westfaelische Rundschau Fix-update Australian Financial Review (images) Fix-update Domani (Italy) +Fix-update El Pais (Spain) Fix-update Globe and Mail (FF for Android v68) Fix-update The Hindu (menu) Fix-update WSJ diff --git a/contentScript.js b/contentScript.js index a83837b..1dbefb2 100755 --- a/contentScript.js +++ b/contentScript.js @@ -1091,7 +1091,7 @@ else if (matchDomain("startribune.com")) { else if (domain = matchDomain("businesstimes.com.sg")) { let url = window.location.href; - let paywall_login = document.querySelector('div.paywall-login'); + let paywall_login = document.querySelector('div.paywall-login2'); if (paywall_login) { window.setTimeout(function () { window.location.href = url + '?amp'; @@ -1166,6 +1166,38 @@ else if (matchDomain(["haz.de", "lvz.de"])) { } } +else if (matchDomain("elpais.com")) { + let login_register = document.querySelector('.login_register'); + if (login_register) { + let scripts = document.querySelectorAll('script'); + let json_script; + for (let script of scripts) { + if (script.innerText.includes('Fusion.globalContent')) + json_script = script; + continue; + } + if (json_script) { + let json_text = json_script.innerHTML.split('Fusion.globalContent=')[1].split(';Fusion.globalContentConfig')[0]; + let json_article = JSON.parse(json_text).content_elements; + let article_body_par = document.querySelector('div.article_body > p'); + if (article_body_par) { + article_body_par.innerText = ''; + let parser = new DOMParser(); + let par_text, par_html; + for (let par of json_article) { + par_html = parser.parseFromString('
' + par.content + '