Add Helsingin Sanomat (hs.fi, not paivanlehti)

Plus fix-update Newsweek (Pelcro)
master
magnolia1234 2020-11-17 17:38:59 +01:00
parent e16491f6ee
commit 5607da592f
8 changed files with 115 additions and 5 deletions

View File

@ -173,6 +173,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
[The Toronto Star](https://www.thestar.com)
#### Europe
##### United Kingdom/Ireland
[Belfast Telegraph](https://www.belfasttelegraph.co.uk) -
[Financial News](https://www.fnlondon.com) -
@ -186,6 +187,10 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
[The Telegraph](https://www.telegraph.co.uk) -
[The Times](https://www.thetimes.co.uk) -
[The Times Literary Supplement](https://www.the-tls.co.uk)
##### Finland
[Helsingin Sanomat](https://www.hs.fi)
##### France/Wallonia
[Alternatives Economiques](https://www.alternatives-economiques.fr) -
[Challenges](https://www.challenges.fr)
@ -202,6 +207,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
[Science & Vie](https://www.science-et-vie.com) -
[Sciences et Avenir](https://www.sciencesetavenir.fr) -
[Valeurs Actuelles](https://www.valeursactuelles.com)
##### Germany/Austria
[Deutsche Wirtschafts Nachrichten](https://deutsche-wirtschafts-nachrichten.de) -
[Die Zeit](https://www.zeit.de) -
@ -217,6 +223,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
[Westfalenpost](https://www.wp.de) -
[Westfälische Rundschau](https://www.wr.de) -
[WirtschaftsWoche](https://www.wiwo.de)
##### Italy
[Corriere Della Sera](https://www.corriere.it) -
[Domani](https://editorialedomani.it) -
@ -234,6 +241,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
[Le Scienze](https://www.lescienze.it) -
[LimesOnline (it/en)](https://www.limesonline.com) -
[Quotidiano.net](https://www.quotidiano.net)
##### Netherlands/Flanders
[Algemeen Dagblad](https://www.ad.nl) and regional ADR sites (grouped in options) like
[BN DeStem](https://www.bndestem.nl) -
@ -259,15 +267,19 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
[Telegraaf](https://www.telegraaf.nl) -
[Trouw](https://www.trouw.nl) -
[Volkskrant](https://www.volkskrant.nl)
##### Russia
[Republic.ru](https://republic.ru)
##### Spain
[ABC](https://www.abc.es) -
[El Mundo](https://www.elmundo.es) -
[El País](https://elpais.com)
##### Sweden
[Aftonbladet](https://www.aftonbladet.se) -
[Dagens Nyheter](https://www.dn.se)
##### Switzerland
[Neue Zürcher Zeitung](https://www.nzz.ch)

View File

@ -14,6 +14,7 @@ const restrictions = {
'elcomercio.pe': /.+\/elcomercio\.pe\/.+((\w)+(\-)+){3,}.+/,
'faz.net': /^((?!\/zeitung\.faz\.net\/).)*$/,
'gestion.pe': /.+\/gestion\.pe\/.+((\w)+(\-)+){3,}.+/,
'hs.fi': /^((?!\/.+\.hs\.fi\/paivanlehti\/).)*$/,
'nknews.org': /^((?!\.nknews\.org\/pro\/).)*$/,
'globo.com': /^((?!\/valor\.globo\.com\/).)*$/,
'quora.com': /^((?!quora\.com\/search\?q=).)*$/,
@ -49,6 +50,7 @@ var allow_cookies_default = [
'haaretz.co.il',
'haaretz.com',
'handelsblatt.com',
'hs.fi',
'ilfattoquotidiano.it',
'ilrestodelcarlino.it',
'independent.ie',
@ -145,6 +147,7 @@ var use_google_bot_default = [
'eurekareport.com.au',
'ft.com',
'handelsblatt.com',
'hs.fi',
'intelligentinvestor.com.au',
'lesoir.be',
'mexiconewsdaily.com',
@ -224,6 +227,7 @@ var blockedRegexes = {
'ladepeche.fr': /.+\.poool\.fr\/.+/,
'lasegunda.com': /segreader\.emol\.cl\/assets\/js\/(vendor\/modal\.js|merPramV\d\.js)/,
'lastampa.it': /.+\.repstatic\.it\/minify\/sites\/lastampa\/.+\/config\.cache\.php\?name=social_js/,
'latercera.com': /cdn\.cxense\.com\/.+/,
'latimes.com': /js\.matheranalytics\.com\/.+/,
'lc.nl': /.+\.evolok\.net\/.+\/authorize\/.+/,
'lejdd.fr': /.+\.poool\.fr\/.+/,
@ -240,7 +244,7 @@ var blockedRegexes = {
'nationalpost.com': /.+\.tinypass\.com\/.+/,
'nationalreview.com': /(.+\.blueconic\.net\/.+|cdn\.ampproject\.org\/v\d\/amp-access-.+\.js)/,
'newrepublic.com': /.+\.onecount\.net\/js\/.+/,
'newsweek.com': /.+\.googletagmanager\.com\/gtm\.js/,
'newsweek.com': /js\.pelcro\.com\/.+/,
'newyorker.com': /.+\.newyorker\.com\/verso\/static\/presenter-articles.+\.js/,
'nknews.org': /.+\.nknews\.org\/wp-content\/plugins\/leaky-paywall-ajax\/js\/leaky-paywall-ajax\.js/,
'nrz.de': /(cdn\.cxense\.com\/.+|.+\.tinypass\.com\/.+)/,

View File

@ -2,6 +2,8 @@
Changelog Bypass Paywalls Clean - Chrome
Post-release
Add Helsingin Sanomat (hs.fi, not paivanlehti)
Fix-update Newsweek (Pelcro)
* v1.9.5.0 (2020-11-15)
Add AlternativesEconomiques.fr

View File

@ -1540,6 +1540,97 @@ else if (matchDomain("alternatives-economiques.fr")) {
}, 500); // Delay (in milliseconds)
}
else if (matchDomain("hs.fi")) {
let url = window.location.href;
if (!url.includes('https://dynamic.hs.fi')) {
let iframe = document.querySelector('iframe[src^="https://dynamic.hs.fi/a/"]');
if (iframe && url.includes('.html')) {
console.log(iframe.src);
window.setTimeout(function () {
window.location.href = iframe.src;
}, 500); // Delay (in milliseconds)
}
} else {
let paywall = document.querySelector('.paywall-container');
if (paywall) {
let scripts = document.querySelectorAll('script');
let json_script;
for (let script of scripts) {
if (script.innerText.includes('window.__NUXT__='))
json_script = script;
continue;
}
let json_text = json_script.innerHTML.replace(/\r\n/g, '').split('amlData:[')[1].split('metaData')[0].split('paywallComponents:[')[1].slice(0, -4);
let main = document.querySelector('main');
if (main) {
let pars = json_text.split('{type:');
let type, value, slides, src, elem, img, caption, caption_text, par_html, par_text;
let parser = new DOMParser();
for (let par of pars) {
type = par.split(',')[0];
if (type === 'i') { // text
value = par.split('value:')[1].split('}')[0];
par_html = parser.parseFromString('<p>' + value + '</p>', 'text/html');
elem = par_html.querySelector('p');
elem.setAttribute('class', 'article-body px-16 mb-24');
main.appendChild(elem);
} else if (type === 'j') { // quote
value = par.split('text:')[1].split(',position:')[0];
par_html = parser.parseFromString('<p>' + value + '</p>', 'text/html');
elem = par_html.querySelector('p');
elem.setAttribute('class', 'article-body px-16 mb-24');
elem.setAttribute('style', 'font-style: italic;');
main.appendChild(elem);
} else if (type === 'h') { // image
src = par.split('src:"')[1].split('",')[0];
elem = document.createElement('p');
elem.setAttribute('class', 'article-body px-16 mb-24');
img = document.createElement('img');
img.setAttribute('src', 'https://arkku.mediadelivery.fi/img/468/' + src);
img.setAttribute('style', 'width:468px !important');
elem.appendChild(img);
caption = document.createElement('figcaption');
caption_text = par.split('caption:')[1].split(',credits:')[0];
if (caption_text.length)
caption_text = caption_text.slice(1, caption_text.length - 1);
caption.innerText = caption_text;
elem.appendChild(caption);
main.appendChild(elem);
} else if (type === 'r') { // slides
slides = par.split('src:');
for (let slide of slides) {
if (slide.includes('.jpg')) {
src = slide.split(',')[0].replace(/"/g, '');
elem = document.createElement('p');
elem.setAttribute('class', 'article-body px-16 mb-24');
img = document.createElement('img');
img.setAttribute('src', 'https://arkku.mediadelivery.fi/img/468/' + src);
img.setAttribute('style', 'width:468px !important');
elem.appendChild(img);
caption = document.createElement('figcaption');
caption_text = slide.split('text:')[1].split(',"text-style"')[0];
if (caption_text.length)
caption_text = caption_text.slice(1, caption_text.length - 1);
caption.innerText = caption_text;
elem.appendChild(caption);
main.appendChild(elem);
}
}
} else
false; //console.log('type: ' + type + ' par: ' + par);
}
main.appendChild(document.createElement('br'));
}
removeDOMElement(paywall);
}
}
}
else if (matchDomain("latercera.com")) {
let subscr_banner = document.querySelector('.empty');
removeDOMElement(subscr_banner);
}
// General Functions
function removeDOMElement(...elements) {
for (let element of elements) {

View File

@ -132,6 +132,7 @@
"*://*.hbrtaiwan.com/*",
"*://*.heraldsun.com.au/*",
"*://*.historyextra.com/*",
"*://*.hs.fi/*",
"*://*.humo.be/*",
"*://*.ilfattoquotidiano.it/*",
"*://*.ilgazzettino.it/*",
@ -318,7 +319,6 @@
"*://*.epimg.net/*",
"*://*.evolok.net/*",
"*://*.flip-pay.com/*",
"*://*.googletagmanager.com/*",
"*://*.htmedia.in/*",
"*://*.jsdelivr.net/*",
"*://*.lightboxcdn.com/*",
@ -335,5 +335,5 @@
"webRequest",
"webRequestBlocking"
],
"version": "1.9.5.0"
"version": "1.9.5.1"
}

View File

@ -17,7 +17,7 @@
</style>
</head>
<body>
<h1>Options | <small><span id="version"></span><span id="version_new"></span></small></h1>
<h1>Options | <small><span id="version"></span><br><span id="version_new"></span></small></h1>
<br><a href="https://bitbucket.org/magnolia1234/bypass-paywalls-chrome-clean/raw/master/changelog.txt" style="color:black" target="_blank">Changelog</a>
<div style="width:90%;">
Selected sites will have their cookies cleared and referer set to Google.

View File

@ -76,6 +76,7 @@ var defaultSites =
"Hartford Courant": "courant.com",
"Harvard Business Review": "hbr.org",
"Harvard Business Review Taiwan": "hbrtaiwan.com",
"Helsingin Sanomat": "hs.fi",
"Humo.be": "humo.be",
"Il Fatto Quotidiano": "ilfattoquotidiano.it",
"Il Manifesto": "ilmanifesto.it",

View File

@ -16,7 +16,7 @@ fetch(manifest_new)
if (version_new.substring(0, version_len) > manifestData.version.substring(0, version_len)) {
var versionString_new = document.getElementById('version_new');
versionString_new.setAttribute('style', 'font-weight: bold;');
versionString_new.appendChild(document.createTextNode(' * '));
versionString_new.appendChild(document.createTextNode('* '));
var anchorEl = document.createElement('a');
anchorEl.text = 'New release v' + version_new;
anchorEl.href = 'https://bitbucket.org/magnolia1234/bypass-paywalls-chrome-clean/downloads';