Fix TopAgrar (js-inline)

Fix Groupe Capitales Medias (identify sites)
merge-requests/18/merge
magnolia1234 5 months ago
parent bab4279ae8
commit b9ce0b38fa

@ -43,7 +43,7 @@ For new sites you also have to opt-in to custom sites/request host permissions f
### Android
Add-on was removed by Mozilla from the [add-on store (AMO)](https://addons.mozilla.org).
With Firefox 122+ you can still install/sideload this add-on by [xpi-file of latest release](https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-latest.xpi) (automatic add-on updates) when you enable the debug menu (settings > about > tap Firefox logo 5 times > return to settings).
With Firefox 122+ (& Android 10+) you can still install/sideload this add-on by [xpi-file of latest release](https://gitlab.com/magnolia1234/bpc-uploads/-/raw/master/bypass_paywalls_clean-latest.xpi) (automatic add-on updates) when you enable the debug menu (settings > about > tap Firefox logo 5 times > return to settings).
Or use the Firefox-fork [Iceraven](https://github.com/fork-maintainers/iceraven-browser) v2.13.2+ (manual add-on updates).\
You can install/update Iceraven manually or use the app [FFUpdater](https://github.com/Tobi823/ffupdater)
@ -635,8 +635,7 @@ Grouped in options:\
[Mannheimer Morgen](https://www.mannheimer-morgen.de)\
*Landwirtschaftsverlag* sites like\
[Profi.de](https://www.profi.de) -
[Top Agrar.at](https://www.topagrar.at) -
[Top Agrar.com](https://www.topagrar.com) -
[Top Agrar](https://www.topagrar.com) -
[Wochenblatt für Landwirtschaft & Landleben](https://www.wochenblatt.com)\
*Madsack Mediengruppe* sites like (opt-in to custom sites for unlisted)\
[Hannoversche Allgemeine Zeitung](https://www.haz.de) -

@ -31,6 +31,8 @@ var restrictions = {
'foreignaffairs.com': /^((?!\/reader\.foreignaffairs\.com\/).)*$/,
'ft.com': /^((?!\/cn\.ft\.com\/).)*$/,
'hilltimes.com': /^((?!\.hilltimes\.com\/slideshow\/).)*$/,
'hindustantimes.com': /^((?!\/epaper\.hindustantimes\.com\/).)*$/,
'livemint.com': /^((?!\/epaper\.livemint\.com\/).)*$/,
'lopinion.fr': /^((?!\.lopinion\.fr\/lejournal).)*$/,
'nytimes.com': /^((?!\/(help|myaccount|timesmachine)\.nytimes\.com\/).)*$/,
'science.org': /^((?!\.science\.org\/doi\/).)*$/,
@ -81,6 +83,8 @@ var amp_unhide;
var amp_redirect;
// block contentScript
var cs_block;
// clear localStorage in contentScript
var cs_clear_lclstrg;
// code for contentScript
var cs_code;
// load text from json (script[type="application/ld+json"])
@ -120,6 +124,7 @@ function initSetRules() {
amp_unhide = [];
amp_redirect = {};
cs_block = {};
cs_clear_lclstrg = [];
cs_code = {};
ld_json = {};
ld_json_next = {};
@ -211,6 +216,8 @@ function prep_regex_str(str, domain = '') {
}
function addRules(domain, rule) {
if (rule.remove_cookies > 0 || rule.hasOwnProperty('remove_cookies_select_hold') || !(rule.hasOwnProperty('allow_cookies') || rule.hasOwnProperty('remove_cookies_select_drop')))
cs_clear_lclstrg.push(domain);
if (rule.hasOwnProperty('remove_cookies_select_drop') || rule.hasOwnProperty('remove_cookies_select_hold')) {
rule.allow_cookies = 1;
rule.remove_cookies = 1;
@ -862,6 +869,9 @@ if (typeof browser !== 'object') {
if (amp_redirect_domain)
bg2csData.amp_redirect = amp_redirect[amp_redirect_domain];
let cs_block_domain = matchUrlDomain(Object.keys(cs_block), url);
let cs_clear_lclstrg_domain = matchUrlDomain(cs_clear_lclstrg, url);
if (cs_clear_lclstrg_domain)
bg2csData.cs_clear_lclstrg = 1;
let cs_code_domain = matchUrlDomain(Object.keys(cs_code), url);
if (cs_code_domain)
bg2csData.cs_code = cs_code[cs_code_domain];
@ -1330,7 +1340,7 @@ function check_update() {
response.json().then(upd_json => {
let ext_id = manifestData.browser_specific_settings.gecko.id;
let json_ext_upd_version_new = upd_json.addons[ext_id].updates[0].version;
setExtVersionNew(json_ext_version_new, json_ext_upd_version_new);
setExtVersionNew(json_ext_version_new, json_ext_upd_version_new);
})
}
}).catch(function (err) {

@ -5,9 +5,11 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release
Add Newsweek.pl (fetch from archive.is)
Remove Abendblatt.de (Funke; fix obsolete)
Fix Groupe Capitales Medias (identify sites)
Fix Grupo Abril (js)
Fix Haaretz Group (anti-adblocker)
Fix LesEchos.fr
Fix TopAgrar (js-inline)
* v3.5.2.0 (2024-01-21)
Add Hln.be (fetch from archive.is)

@ -15,7 +15,7 @@ var be_roularta_domains = ['artsenkrant.com', 'beleggersbelangen.nl', 'femmesdau
var ca_gcm_domains = ['lesoleil.com'].concat(['latribune.ca', 'lavoixdelest.ca', 'ledroit.com', 'ledroitfranco.com', 'lenouvelliste.ca', 'lequotidien.com']);
var ca_torstar_domains = ['niagarafallsreview.ca', 'stcatharinesstandard.ca', 'thepeterboroughexaminer.com', 'therecord.com', 'thespec.com', 'thestar.com', 'wellandtribune.ca'];
var de_funke_medien_domains = ['ikz-online.de', 'nrz.de', 'otz.de', 'thueringer-allgemeine.de', 'tlz.de', 'waz.de', 'wp.de', 'wr.de'];
var de_lv_domains = ['profi.de', 'topagrar.at', 'topagrar.com', 'wochenblatt.com'];
var de_lv_domains = ['profi.de', 'wochenblatt.com'];
var de_madsack_domains = ['haz.de', 'kn-online.de', 'ln-online.de', 'lvz.de', 'maz-online.de', 'neuepresse.de', 'ostsee-zeitung.de', 'rnd.de'];
var de_mhs_custom_domains = ['cannstatter-zeitung.de', 'esslinger-zeitung.de', 'frankenpost.de', 'insuedthueringen.de', 'krzbb.de', 'kurier.de', 'np-coburg.de'];
var de_vrm_domains = ['allgemeine-zeitung.de', 'echo-online.de', 'wiesbadener-kurier.de'];
@ -52,13 +52,15 @@ var usa_nymag_domains = ['curbed.com', 'grubstreet.com', 'nymag.com', 'thecut.co
var usa_outside_mag_domains = ["backpacker.com", "betamtb.com", "betternutrition.com", "cleaneatingmag.com", "climbing.com", "outsideonline.com", "oxygenmag.com", "skimag.com", "trailrunnermag.com", "triathlete.com", "vegetariantimes.com", "womensrunning.com", "yogajournal.com"];
var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com'];
// clean local storage of sites (with an exemption for hold-list)
var arr_localstorage_hold = ['augsburger-allgemeine.de', 'barrons.com', 'business-standard.com', 'businessinsider.com', 'businessoffashion.com', 'businesspost.ie', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'columbian.com', 'corriere.it', 'corrieredellosport.it', 'crikey.com.au', 'cyclingtips.com', 'digiday.com', 'dvhn.nl', 'economictimes.com', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'enotes.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'freiepresse.de', 'gauchazh.clicrbs.com.br', 'globo.com', 'ilfoglio.it', 'inc42.com', 'indianexpress.com', 'indiatoday.in', 'inews.co.uk', 'janes.com', 'jazziz.com', 'ksta.de', 'kurier.at', 'lanouvellerepublique.fr', 'latimes.com', 'lc.nl', 'lesechos.fr', 'limburger.nl', 'livemint.com', 'mid-day.com', 'mundodeportivo.com', 'nationalreview.com', 'nrc.nl', 'nw.de', 'nytimes.com', 'nzherald.co.nz', 'record.pt', 'ruhrnachrichten.de', 'rundschau-online.de', 'sandiegouniontribune.com', 'scmp.com', 'seekingalpha.com', 'techinasia.com', 'telegraph.co.uk', 'tes.com', 'the-tls.co.uk', 'theatlantic.com', 'thebulletin.org', 'thecritic.co.uk', 'thetimes.co.uk', 'theweek.com', 'tt.com', 'tuttosport.com', 'uol.com.br', 'vol.at', 'weser-kurier.de', 'wsj.com'].concat(be_mediahuis_domains, be_roularta_domains, ca_gcm_domains, ca_torstar_domains, de_funke_medien_domains, de_lv_domains, de_vrm_domains, de_vrm_custom_domains, es_epiberica_domains, es_epiberica_custom_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, it_gedi_domains, it_quotidiano_domains, nl_dpg_media_domains, no_nhst_media_domains, timesofindia_domains, usa_hearst_comm_domains, usa_mcc_domains);
if (!matchDomain(arr_localstorage_hold)) {
// clean local storage (when allow cookies)
if (matchDomain(['bloomberg.com', 'csmonitor.com', 'exame.com', 'slideshare.net'])) {
window.localStorage.clear();
}
function runOnMessage(bg2csData, dompurify_loaded) {
// clear local storage (when remove cookies)
if (bg2csData.cs_clear_lclstrg && !matchDomain(['nationalreview.com', 'thecritic.co.uk'].concat(usa_mcc_domains)))
window.localStorage.clear();
// custom/updated sites: load text from json (script[type="application/ld+json"])
if (bg2csData.ld_json && dompurify_loaded) {
if (bg2csData.ld_json.includes('|')) {
@ -317,6 +319,10 @@ window.addEventListener('message', function (event) {
}
}, false);
var overlay = document.querySelector('body.didomi-popup-open');
if (overlay)
overlay.classList.remove('didomi-popup-open');
if (!(csDone || csDoneOnce)) {
var msg_once_ses;
@ -582,7 +588,7 @@ else {
csDone = true;
}
} else if (window.location.hostname.match(/\.(de|at|ch)$/) || matchDomain(['diepresse.com', 'faz.net', 'topagrar.com', 'tt.com', 'wochenblatt.com'])) {//germany/austria/switzerland - ch
} else if (window.location.hostname.match(/\.(de|at|ch)$/) || matchDomain(['diepresse.com', 'faz.net', 'tt.com', 'wochenblatt.com'])) {//germany/austria/switzerland - ch
if (matchDomain('aerztezeitung.de')) {
let paywall = document.querySelector('div.AZLoginModule');
@ -1371,15 +1377,10 @@ else if (matchDomain('zeit.de')) {
}
else if (matchDomain(de_lv_domains)) {
let paywall_topagrar = document.querySelector('div > div.paywall-package');
let paywall_other = document.querySelector('div[id^="paymentprocess-"]');
if (paywall_topagrar || paywall_other) {
if (paywall_topagrar)
removeDOMElement(paywall_topagrar.parentNode);
else {
let intro = document.querySelector('div.m-paywall__textFadeOut');
removeDOMElement(paywall_other, intro);
}
let paywall = document.querySelector('div[id^="paymentprocess-"]');
if (paywall) {
let intro = document.querySelector('div.m-paywall__textFadeOut');
removeDOMElement(paywall, intro);
let div_hidden = document.querySelector('div.paywall-full-content[style]');
if (div_hidden) {
div_hidden.removeAttribute('class');
@ -2391,11 +2392,6 @@ else if (matchDomain(be_mediahuis_domains.concat(['limburger.nl']))) {
let banners = document.querySelectorAll('div.paywall--titel');
hideDOMElement(...banners);
}, 1500);
window.setTimeout(function () {
let overlay = document.querySelector('body.didomi-popup-open');
if (overlay)
overlay.classList.remove('didomi-popup-open');
}, 3000);
}
else if (matchDomain('businessam.be')) {
@ -3885,9 +3881,14 @@ else if (matchDomain('foreignpolicy.com')) {
let content_gated = document.querySelector('div.content-gated');
if (content_gated) {
let insider = document.querySelector('body.is-fp-insider');
if (insider)
if (insider) {
getJsonUrl('div.content-gated', {rm_class: 'content-gated'}, 'div.content-gated');
else
window.setTimeout(function () {
let lazy_images = document.querySelectorAll('img[loading="lazy"]');
for (let elem of lazy_images)
elem.removeAttribute('loading');
}, 1000);
} else
content_gated.classList.remove('content-gated');
}
}
@ -4206,7 +4207,7 @@ else if (matchDomain('jpost.com')) {
}
else if (matchDomain(['latimes.com', 'sandiegouniontribune.com'])) {
let ads = document.querySelectorAll('div.enhancement, div.google-dfp-ad-wrapper');
let ads = document.querySelectorAll('div.enhancement, div.google-dfp-ad-wrapper, div.revcontent');
hideDOMElement(...ads);
}

@ -104,7 +104,7 @@ window.setTimeout(function () {
else if (matchDomain(['investmentweek.co.uk']))
group = '###_uk_incisive_media';
} else if (hostname.match(/\.(ca|com|net|news|org)$/)) {
if (document.querySelector('picture > source[srcset*="%2Fgcm.omerlocdn.com%2F"]'))
if (matchDomain(['latribune.ca', 'lavoixdelest.ca', 'ledroit.com', 'lenouvelliste.ca', 'lequotidien.com']))
group = '###_ca_gcm';
else if (document.querySelector('script[src*=".postmedia.digital/"], head > meta[content*=".postmedia.digital/"]'))
group = '###_ca_postmedia';

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.5.2.3"
"version": "3.5.2.4"
}

@ -721,7 +721,6 @@
"*://*.timesofindia.com/*",
"*://*.timesunion.com/*",
"*://*.tirebusiness.com/*",
"*://*.topagrar.at/*",
"*://*.topagrar.com/*",
"*://*.torontosun.com/*",
"*://*.towardsdatascience.com/*",
@ -840,5 +839,5 @@
"*://archive.vn/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.5.2.3"
"version": "3.5.2.4"
}

@ -424,7 +424,7 @@ var defaultSites = {
},
"Corriere dello Sport": {
domain: "corrieredellosport.it",
remove_cookies_select_drop: ["paywall_articles"]
allow_cookies: 1
},
"Cosmopolitan.fr": {
domain: "cosmopolitan.fr",
@ -724,6 +724,7 @@ var defaultSites = {
},
"Foreign Affairs": {
domain: "foreignaffairs.com",
allow_cookies: 1,
block_regex: /\.foreignaffairs\.com\/modules\/custom\/fa_paywall_js\/js\/paywall\.js/
},
"Foreign Policy": {
@ -827,7 +828,7 @@ var defaultSites = {
"lesoleil.com"
],
allow_cookies: 1,
remove_cookies: 1
block_regex: /\.poool\.fr\//
},
"Groupe Centre France": {
domain: "###_fr_gcf",
@ -1139,7 +1140,7 @@ var defaultSites = {
domain: "hindutamil.in",
allow_cookies: 1
},
"Hindustan Times": {
"Hindustan Times (not epaper)": {
domain: "hindustantimes.com",
allow_cookies: 1,
block_regex: /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/
@ -1373,9 +1374,15 @@ var defaultSites = {
domain: "###_de_lv",
group: [
"profi.de",
"topagrar.at",
"topagrar.com",
"wochenblatt.com"
],
allow_cookies: 1,
exception: [{
domain: "topagrar.com",
allow_cookies: 1,
block_js_inline: /\.topagrar\.com\/.+\/news\//
}
]
},
"Law.com (free articles only)": {
@ -1469,7 +1476,7 @@ var defaultSites = {
domain: "livelaw.in",
allow_cookies: 1
},
"LiveMint": {
"LiveMint (not epaper)": {
domain: "livemint.com",
allow_cookies: 1,
block_regex: /(\.livemint\.com\/__js\/lm_subscription|\.piano\.io\/api\/tinypass\.min\.js|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/
@ -1484,6 +1491,7 @@ var defaultSites = {
},
"Los Angeles Times": {
domain: "latimes.com",
allow_cookies: 1,
block_regex: /\.californiatimes\.com\/meteringjs/
},
"MacroBusiness.com.au": {
@ -1813,6 +1821,7 @@ var defaultSites = {
},
"O Globo (& Valor Econômico)": {
domain: "globo.com",
allow_cookies: 1,
block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js)/
},
"Outdoor Life": {
@ -2054,6 +2063,7 @@ var defaultSites = {
},
"San Diego Union Tribune": {
domain: "sandiegouniontribune.com",
allow_cookies: 1,
block_regex: /\.californiatimes\.com\/meteringjs/
},
"Schwäbische Zeitung": {
@ -2659,6 +2669,7 @@ var defaultSites = {
"echo-online.de",
"wiesbadener-kurier.de"
],
allow_cookies: 1,
block_regex: /cdn\.cxense\.com\//,
useragent: "googlebot"
},

@ -92,6 +92,22 @@
"block_regex": "temptation\\.hln\\.be\\/temptation\\.js",
"upd_version": "3.5.1.5"
},
"Landwirtschaftsverlag": {
"domain": "###_de_lv",
"group": [
"profi.de",
"topagrar.com",
"wochenblatt.com"
],
"allow_cookies": 1,
"exception": [{
"domain": "topagrar.com",
"allow_cookies": 1,
"block_js_inline": "\\.topagrar\\.com\\/.+\\/news\\/"
}
],
"upd_version": "3.5.2.4"
},
"Le Parisien": {
"domain": "leparisien.fr",
"allow_cookies": 1,

Loading…
Cancel
Save