mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 06:07:47 +01:00
Fix Gazzetta.it (text only)
This commit is contained in:
parent
9a353cee42
commit
286872a9cf
5 changed files with 35 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -51,5 +51,5 @@
|
|||
"webRequestBlocking",
|
||||
"*://*/*"
|
||||
],
|
||||
"version": "3.2.1.2"
|
||||
"version": "3.2.1.3"
|
||||
}
|
||||
|
|
|
@ -757,5 +757,5 @@
|
|||
"*://*.wyleex.com/*",
|
||||
"*://webcache.googleusercontent.com/*"
|
||||
],
|
||||
"version": "3.2.1.2"
|
||||
"version": "3.2.1.3"
|
||||
}
|
||||
|
|
2
sites.js
2
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
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue