Fix LesEchos.fr

Fix Grupo Abril (js)
This commit is contained in:
magnolia1234 2024-01-22 17:51:00 +01:00
parent a65507d27f
commit 5de91f6ca5
10 changed files with 77 additions and 69 deletions

View file

@ -946,7 +946,7 @@ if (typeof browser !== 'object') {
}
}
var set_var_sites = ['abril.com.br', 'journaldemontreal.com', 'journaldequebec.com', 'nzherald.co.nz', 'theglobeandmail.com'].concat(de_madsack_domains);
var set_var_sites = ['journaldemontreal.com', 'journaldequebec.com', 'nzherald.co.nz', 'theglobeandmail.com'].concat(de_madsack_domains);
function runOnTab_once_var(tab) {
let tabId = tab.id;
let url = tab.url;

View file

@ -3,6 +3,8 @@ Changelog Bypass Paywalls Clean - Firefox
Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/releases
Post-release
Fix Grupo Abril (js)
Fix LesEchos.fr
* v3.5.2.0 (2024-01-21)
Add Hln.be (fetch from archive.is)

View file

@ -1920,47 +1920,51 @@ else if (matchDomain('lesechos.fr')) {
ampToHtml();
} else {
window.setTimeout(function () {
let abo_banner = document.querySelector('div[class*="pgxf3b-2"]');
let ad_blocks = document.querySelectorAll('[class*="jzxvkd"]');
hideDOMElement(...ad_blocks);
if (abo_banner && dompurify_loaded) {
removeDOMElement(abo_banner);
let url = window.location.href;
let html = document.documentElement.outerHTML;
try {
let split1 = html.split(/window\.__REACT_QUERY_STATE__\s?=/)[1];
let state = split1.split('</script>')[0].trim().replace(/;$/, '');
let data = JSON.parse(state);
let data_article = data.queries[1].state;
let url_loaded = data_article.data.path;
if (url_loaded && (!url_loaded.slice(-7).match(/\d+/) || !url.includes(url_loaded.slice(-7))))
refreshCurrentTab();
else {
let article = data_article.data.stripes[0].mainContent[0].data.description.replace(/allowfullscreen='(true)?'/g, '');
let paywallNode = document.querySelector('.post-paywall');
if (paywallNode) {
let contentNode = document.createElement('div');
let parser = new DOMParser();
let article_html = parser.parseFromString('<div>' + DOMPurify.sanitize(article) + '</div>', 'text/html');
let article_par = article_html.querySelector('div');
if (article_par) {
contentNode.appendChild(article_par);
contentNode.className = paywallNode.className;
paywallNode.before(contentNode);
removeDOMElement(paywallNode);
let paywallLastChildNode = document.querySelector('.post-paywall > :last-child');
if (paywallLastChildNode) {
paywallLastChildNode.setAttribute('style', 'height: auto !important; overflow: hidden !important; max-height: none !important;');
let paywall = document.querySelector('div#paywall');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let scripts = document.querySelectorAll('script:not([src]):not([type])');
let json_script;
for (let script of scripts) {
if (script.text.match(/window\.__REACT_QUERY_STATE__\s?=\s?/)) {
json_script = script;
break;
}
}
if (json_script) {
try {
let json = JSON.parse(json_script.text.split(/window\.__REACT_QUERY_STATE__\s?=\s?/)[1].split('};')[0] + '}');
let data_article = json.queries[1].state;
let url = window.location.href;
let url_loaded = data_article.data.path;
if (url_loaded && (!url_loaded.slice(-7).match(/\d+/) || !url.includes(url_loaded.slice(-7))))
refreshCurrentTab();
else {
let json_text = data_article.data.stripes[0].mainContent[0].data.description.replace(/allowfullscreen='(true)?'/g, '');
let article = document.querySelector('div.post-paywall');
if (article) {
let contentNode = document.createElement('div');
let parser = new DOMParser();
let doc = parser.parseFromString('<div class="' + article.className + '">' + DOMPurify.sanitize(json_text, dompurify_options) + '</div>', 'text/html');
let article_new = doc.querySelector('div');
if (article.parentNode && article_new) {
article.parentNode.replaceChild(article_new, article);
let article_lastnode = document.querySelector('.post-paywall > :last-child');
if (article_lastnode) {
article_lastnode.setAttribute('style', 'height: auto !important; overflow: hidden !important; max-height: none !important;');
}
}
}
let styleElem = document.head.appendChild(document.createElement('style'));
styleElem.innerText = ".post-paywall::after {height: auto !important;}";
}
let styleElem = document.head.appendChild(document.createElement('style'));
styleElem.innerHTML = ".post-paywall::after {height: auto !important;}";
} catch (err) {
console.log(err);
}
} catch (err) {
console.log(err);
}
}
let ads = document.querySelectorAll('[class*="jzxvkd"]');
hideDOMElement(...ads);
}, 500);
}
}
@ -3093,7 +3097,7 @@ else if (matchDomain(uk_nat_world_domains) || document.querySelector('footer > d
else
csDone = true;
} else if (window.location.hostname.match(/\.(ar|br|cl|pe|uy)$/) || matchDomain(['cambiocolombia.com', 'clarin.com', 'elespectador.com', 'elmercurio.com', 'eltiempo.com', 'eltribuno.com', 'globo.com', 'lasegunda.com', 'latercera.com', 'revistaoeste.com'])) {//south america
} else if (window.location.hostname.match(/\.(ar|br|cl|pe|uy)$/) || matchDomain(['cambiocolombia.com', 'clarin.com', 'elespectador.com', 'elmercurio.com', 'eltiempo.com', 'eltribuno.com', 'exame.com', 'globo.com', 'lasegunda.com', 'latercera.com', 'revistaoeste.com'])) {//south america
if (matchDomain('abril.com.br')) {
if (window.location.pathname.endsWith('/amp/')) {
@ -3102,7 +3106,7 @@ if (matchDomain('abril.com.br')) {
let amp_ads = document.querySelectorAll('amp-ad, amp-embed');
hideDOMElement(...amp_ads);
} else {
let ads = document.querySelectorAll('div.ads, div[class^="ads-"]');
let ads = document.querySelectorAll('div.ads, div[class^="ads-"], div.MGID');
hideDOMElement(...ads);
}
}
@ -3262,6 +3266,11 @@ else if (matchDomain('estadao.com.br')) {
}
}
else if (matchDomain('exame.com')) {
let ads = document.querySelectorAll('div[id^="ads_"]');
hideDOMElement(...ads);
}
else if (matchDomain('folha.uol.com.br')) {
if (window.location.pathname.startsWith('/amp/')) {
amp_unhide_subscr_section('amp-ad, amp-sticky-ad, amp-embed');
@ -5318,7 +5327,7 @@ else if (matchDomain(timesofindia_domains)) {
content.innerHTML = '';
let sheet = document.createElement('style');
sheet.innerText = '[type="synopsis"]::after {background: none !important;}';
document.body.appendChild(sheet);
document.head.appendChild(sheet);
content.appendChild(article_new);
}
}

View file

@ -21,17 +21,6 @@ if (matchDomain(de_madsack_domains) || document.querySelector('head > link[href*
}
else if (matchDomain('abril.com.br')) {
function abril_main() {
for (let n = 0; n < 10; n++) {
window.setTimeout(function () {
window.wp_paywall_vars = '';
}, n * 50);
}
}
insert_script(abril_main);
}
else if (matchDomain(['journaldemontreal.com', 'journaldequebec.com'])) {
for (let n = 0; n < 10; n++) {
window.setTimeout(function () {

View file

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.5.2.0"
"version": "3.5.2.1"
}

View file

@ -1,6 +1,6 @@
{
"###_remove_sites": {
"cs_code": "al-monitor.com, arkansasonline.com, bild.de, dn.se, doorbraak.be, gp.se, group_haaretz, handelsblatt.com, politiken.dk, rp-online.de, sueddeutsche.de, theinformation.com",
"cs_code": "bild.de, dn.se, gp.se, group_haaretz, handelsblatt.com, politiken.dk, rp-online.de, sueddeutsche.de, theinformation.com",
"domain": "###"
},
"Abajournal.com": {
@ -331,6 +331,16 @@
"block_regex": "\\.irishnews\\.com\\/.+\\/js\\/(bundle|mpppaywall)\\.js",
"domain": "irishnews.com"
},
"Jornaldocomercio.com": {
"allow_cookies": 1,
"block_regex": "\\.jornaldocomercio\\.com\\/.+\\/json\\/paywall\\.json",
"domain": "jornaldocomercio.com"
},
"Jota.info": {
"allow_cookies": 1,
"domain": "jota.info",
"ld_json_url": "div.jota-paywall-visible|div.jota-article__content>span>p"
},
"Kapital.no": {
"allow_cookies": 1,
"domain": "kapital.no",
@ -512,6 +522,11 @@
"domain": "onet.pl",
"remove_cookies": 1
},
"Opovo.com.br": {
"allow_cookies": 1,
"block_regex": "\\.opovo\\.com\\.br\\/.+\\/js\\/auth\\/auth_new_menu.min\\.js",
"domain": "opovo.com.br"
},
"Ovb-online.de": {
"allow_cookies": 1,
"block_regex": "\\.ovb-online\\.de\\/sub\\/js\\/pc-offer-west\\.js",

View file

@ -840,5 +840,5 @@
"*://archive.vn/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.5.2.0"
"version": "3.5.2.1"
}

View file

@ -680,7 +680,7 @@ var defaultSites = {
},
"Exame": {
domain: "exame.com",
block_regex: /\/exame\.com\/.+\/js\/pywll-dyn\.js/
allow_cookies: 1
},
"Fast Company": {
domain: "fastcompany.com",
@ -928,7 +928,8 @@ var defaultSites = {
},
"Grupo Abril": {
domain: "abril.com.br",
allow_cookies: 1
allow_cookies: 1,
block_regex: /\.abril\.com\.br\/.+\/abril-paywall\//
},
"Grupo Clarín": {
domain: "###_ar_grupo_clarin",

View file

@ -25,12 +25,11 @@
"add_ext_link_type": "archive.is",
"upd_version": "3.5.0.4"
},
"Haaretz": {
"domain": "haaretz.co.il",
"Grupo Abril": {
"domain": "abril.com.br",
"allow_cookies": 1,
"add_ext_link": "meta[property='og:url'][content*='/.']|article header",
"add_ext_link_type": "archive.is",
"upd_version": "3.4.9.2"
"block_regex": "\\.abril\\.com\\.br\\/.+\\/abril-paywall\\/",
"upd_version": "3.5.2.1"
},
"Hearst Communications magazines": {
"domain": "###_usa_hearst_comm_mag",
@ -114,13 +113,6 @@
"block_regex": "(\\.{domain}\\/(script||.+\\/tncms\\/api\\/access\\..+)\\.js|js\\.matheranalytics\\.com\\/)",
"upd_version": "3.5.1.7"
},
"The Indian Express": {
"domain": "indianexpress.com",
"allow_cookies": 1,
"block_regex": "cdn\\.ampproject\\.org\\/v\\d\\/amp-access-.+\\.js",
"cs_code": "[{\"cond\":\"ev-engagement\", \"rm_elem\": 1, \"elems\":[{\"cond\":\"div.ev-meter-content\", \"rm_attrib\": \"style\"}, {\"cond\":\"p.first_intro_para\", \"rm_attrib\": \"class\"}]}]",
"upd_version": "3.4.9.9"
},
"The Irish Examiner": {
"domain": "irishexaminer.com",
"allow_cookies": 1,

View file

@ -2,8 +2,8 @@
"addons": {
"magnolia@12.34": {
"updates": [
{ "version": "3.5.1.0",
"update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.5.1.0.xpi" }
{ "version": "3.5.2.0",
"update_link": "https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-3.5.2.0.xpi" }
]
}
}