diff --git a/changelog.txt b/changelog.txt index 63c0ab3..0421099 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal Post-release Add Follow the Money (Ftm.eu) +Fix Gazzetta.it (text only) Fix LeScienze.it Fix LeTelegramme.fr (css) Fix The Athletic (timing) diff --git a/contentScript.js b/contentScript.js index ee01ab2..e522ab4 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1856,11 +1856,41 @@ else if (matchDomain('eastwest.eu')) { } else if (matchDomain('gazzetta.it')) { + function header_nofix(header) { + if (header) { + let nofix_div = document.createElement('div'); + nofix_div.setAttribute('style', 'margin: 20px; font-weight: bold; color: red;'); + nofix_div.innerText = 'BPC > no fix'; + header.appendChild(nofix_div); + } + } if (window.location.pathname.endsWith('_preview.shtml')) { let paywall = document.querySelector('section.bck-freemium__wall'); if (paywall) { removeDOMElement(paywall); - window.location.href = window.location.pathname.replace('_preview', '') + '?gaa_at=g'; + if (!window.location.search.startsWith('?reason=unauthenticated')) { + window.location.href = window.location.pathname.replace('_preview', '') + '?gaa_at=g'; + } else { + let json_script = getArticleJsonScript(); + let header = document.querySelector('div.content > h2'); + if (json_script) { + let json = JSON.parse(json_script.text); + if (json) { + let json_text = json.articleBody.replace(/(\s{3}| )/g, '\r\n\r\n'); + let content = document.querySelector('div.content > p.has-first-letter'); + if (json_text && content) { + let content_new = document.createElement('p'); + content_new.innerText = json_text; + content.parentNode.replaceChild(content_new, content); + let article_body = document.querySelector('section.body-article'); + if (article_body) + article_body.style = 'height: auto;'; + } else + header_nofix(header); + } + } else + header_nofix(header); + } } } else if (window.location.pathname.endsWith('_amp.shtml')) ampToHtml(); diff --git a/custom/manifest.json b/custom/manifest.json index fdbaec5..9b28a48 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.2.1.2" + "version": "3.2.1.3" } diff --git a/manifest.json b/manifest.json index c6bd734..a8165e0 100644 --- a/manifest.json +++ b/manifest.json @@ -757,5 +757,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.2.1.2" + "version": "3.2.1.3" } diff --git a/sites.js b/sites.js index c6559a0..84526c0 100644 --- a/sites.js +++ b/sites.js @@ -1133,7 +1133,7 @@ var defaultSites = { allow_cookies: 1, useragent: "googlebot" }, - "La Gazzetta dello Sport": { + "La Gazzetta dello Sport (text only)": { domain: "gazzetta.it", allow_cookies: 1 },