mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 03:11:56 +01:00
Add ArcInfo.ch
This commit is contained in:
parent
657372c800
commit
60c48a68eb
6 changed files with 58 additions and 3 deletions
|
@ -673,6 +673,7 @@ Grouped in options:\
|
|||
[NyTeknik](https://www.nyteknik.se)
|
||||
|
||||
##### Switzerland
|
||||
[ArcInfo](https://www.arcinfo.ch) -
|
||||
[Beobachter](https://www.beobachter.ch) -
|
||||
[Handelszeitung](https://www.handelszeitung.ch) -
|
||||
[Neue Zürcher Zeitung (+ regional/opt-in to custom sites)](https://www.nzz.ch) -
|
||||
|
|
|
@ -6,7 +6,7 @@ var ext_name = manifestData.name;
|
|||
var ext_version = manifestData.version;
|
||||
|
||||
const cs_limit_except = ['elespanol.com', 'faz.net', 'nation.africa', 'nationalgeographic.com'].concat(de_westfalen_medien_domains);
|
||||
const dompurify_sites = ['asiatimes.com', 'bloomberg.com', 'cicero.de', 'ilmanifesto.it', 'iltalehti.fi', 'iltirreno.it', 'ipolitics.ca', 'italiaoggi.it', 'lanuovasardegna.it', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newscientist.com', 'nzherald.co.nz', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'spectator.co.uk', 'stratfor.com', 'techinasia.com', 'timesofindia.com', 'valor.globo.com', 'vn.nl'].concat(be_mediahuis_domains, nl_mediahuis_region_domains, no_nhst_media_domains);
|
||||
const dompurify_sites = ['arcinfo.ch', 'asiatimes.com', 'bloomberg.com', 'cicero.de', 'ilmanifesto.it', 'iltalehti.fi', 'iltirreno.it', 'ipolitics.ca', 'italiaoggi.it', 'lanuovasardegna.it', 'lesechos.fr', 'marianne.net', 'newleftreview.org', 'newscientist.com', 'nzherald.co.nz', 'outlookbusiness.com', 'prospectmagazine.co.uk', 'spectator.co.uk', 'stratfor.com', 'techinasia.com', 'timesofindia.com', 'valor.globo.com', 'vn.nl'].concat(be_mediahuis_domains, nl_mediahuis_region_domains, no_nhst_media_domains);
|
||||
var currentTabUrl = '';
|
||||
var csDone = false;
|
||||
var optin_setcookie = false;
|
||||
|
|
|
@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox
|
|||
|
||||
Post-release
|
||||
Add Aachener Nachrichten & Zeitung
|
||||
Add ArcInfo.ch
|
||||
Add NK News (free articles only)
|
||||
Add 5 more Gannett sites
|
||||
Fix NHST Media Group
|
||||
|
|
|
@ -470,6 +470,47 @@ if (matchDomain('allgaeuer-zeitung.de')) {
|
|||
}
|
||||
}
|
||||
|
||||
else if (matchDomain('arcinfo.ch')) {
|
||||
let paywall = document.querySelector('section#paywall-articles');
|
||||
if (paywall && dompurify_loaded) {
|
||||
removeDOMElement(paywall);
|
||||
let url = window.location.href;
|
||||
let html = document.documentElement.outerHTML;
|
||||
let json;
|
||||
if (html.includes('window.__NUXT__='))
|
||||
json = html.split('window.__NUXT__=')[1].split('</script>')[0].trim();
|
||||
let article_old = document.querySelector('section > div > div.html-content');
|
||||
let article = document.querySelector('div.html-content');
|
||||
if (article && json) {
|
||||
let content = '';
|
||||
if (json.includes('.text_1="'))
|
||||
content = json.split('.text_1="')[1].split('";')[0];
|
||||
else {
|
||||
let parts = json.split('html:"');
|
||||
let search = article.querySelector('p');
|
||||
if (search) {
|
||||
for (let part of parts) {
|
||||
if (decodeHtmlText(part).includes(search.innerText.slice(20, 50))) {
|
||||
content = part.split('",has_pre_content')[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (content) {
|
||||
content = content.replace(/\\u003C/g, '<').replace(/\\u003E/g, '>').replace(/\\u002F/g, '/').replace(/\\"/g, '"').replace(/\\r\\n/g, '');
|
||||
let parser = new DOMParser();
|
||||
let content_new = parser.parseFromString('<div class="html-content">' + DOMPurify.sanitize(content) + '</div>', 'text/html');
|
||||
let article_top = article.parentNode.parentNode;
|
||||
article_top.appendChild(content_new.querySelector('div'));
|
||||
removeDOMElement(article.parentNode);
|
||||
} else {
|
||||
window.location.reload(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (matchDomain('augsburger-allgemeine.de')) {
|
||||
let url = window.location.href;
|
||||
if (!url.includes('-amp.html')) {
|
||||
|
@ -4334,6 +4375,13 @@ function parseHtmlEntities(encodedString) {
|
|||
});
|
||||
}
|
||||
|
||||
function decodeHtmlText(str) {
|
||||
let parser = new DOMParser();
|
||||
let doc = parser.parseFromString('<textarea>' + str + '</textarea>', 'text/html');
|
||||
let dom = doc.querySelector('textarea');
|
||||
return dom.value;
|
||||
}
|
||||
|
||||
function encode_utf8(str) {
|
||||
return unescape(encodeURIComponent(str));
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
"*://*.ara.cat/*",
|
||||
"*://*.arabalears.cat/*",
|
||||
"*://*.architecturaldigest.com/*",
|
||||
"*://*.arcinfo.ch/*",
|
||||
"*://*.artforum.com/*",
|
||||
"*://*.artnet.com/*",
|
||||
"*://*.arvopaperi.fi/*",
|
||||
|
@ -715,5 +716,5 @@
|
|||
"*://gcm.omerlocdn.com/*",
|
||||
"*://webcache.googleusercontent.com/*"
|
||||
],
|
||||
"version": "2.8.6.3"
|
||||
"version": "2.8.6.4"
|
||||
}
|
||||
|
|
6
sites.js
6
sites.js
|
@ -98,6 +98,10 @@ var defaultSites = {
|
|||
block_regex: /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/,
|
||||
useragent: "googlebot"
|
||||
},
|
||||
"ArcInfo.ch": {
|
||||
domain: "arcinfo.ch",
|
||||
allow_cookies: 1
|
||||
},
|
||||
"Artforum": {
|
||||
domain: "artforum.com"
|
||||
},
|
||||
|
@ -2252,4 +2256,4 @@ init_custom_domains();
|
|||
|
||||
// sites with no fix (background)
|
||||
var nl_dpg_media_nofix_domains = ['ad.nl', 'bd.nl', 'bndestem.nl', 'destentor.nl', 'ed.nl', 'gelderlander.nl', 'hln.be', 'pzc.nl', 'tubantia.nl'];
|
||||
var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'cnbc.com', 'courrierinternational.com', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'handelsblatt.com', 'hln.be', 'hs.fi', 'ilsole24ore.com', 'jacobinmag.com', 'jeunesafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'liberation.fr', 'mediapart.fr', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nbr.co.nz', 'nieuwsblad.be', 'ouest-france.fr', 'politiken.dk', 'publico.pt', 'republic.ru', 'rp-online.de', 'standaard.be', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'tagesspiegel.de', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'welt.de', 'worldpoliticsreview.com', 'ynet.co.il'].concat(nl_dpg_media_nofix_domains);
|
||||
var nofix_sites = ['africaintelligence.com', 'africaintelligence.fr', 'aftenposten.no', 'bild.de', 'borsen.dk', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'cnbc.com', 'courrierinternational.com', 'dn.se', 'elordenmundial.com', 'epw.in', 'expresso.pt', 'ftchinese.com', 'handelsblatt.com', 'hln.be', 'hs.fi', 'ilsole24ore.com', 'jacobinmag.com', 'jeunesafrique.com', 'kurier.at', 'lavozdegalicia.es', 'leconomiste.com', 'lefigaro.fr', 'lemonde.fr', 'lepoint.fr', 'letemps.ch', 'liberation.fr', 'mediapart.fr', 'milanofinanza.it', 'mondediplo.com', 'moneycontrol.com', 'nbr.co.nz', 'nieuwsblad.be', 'ouest-france.fr', 'politiken.dk', 'publico.pt', 'republic.ru', 'rp-online.de', 'standaard.be', 'statnews.com', 'stern.de', 'straitstimes.com', 'sueddeutsche.de', 'tagesanzeiger.ch', 'tagesspiegel.de', 'the-ken.com', 'theinformation.com', ' themorningcontext.com', 'theparisreview.org', 'thewirechina.com', 'welt.de', 'worldpoliticsreview.com', 'ynet.co.il'].concat(nl_dpg_media_nofix_domains);
|
||||
|
|
Loading…
Reference in a new issue