Add Knack.be

This commit is contained in:
magnolia1234 2020-06-26 19:56:58 +02:00
parent 1a8d5f6aef
commit 2732dd7fe5
5 changed files with 20 additions and 0 deletions

View file

@ -202,6 +202,7 @@ Install add-on by downloading xpi-file.
[Groene Amsterdammer](https://www.groene.nl) -
[Het Financieel Dagblad](https://fd.nl) -
[Humo.be](https://www.humo.be) -
[Knack.be](https://www.knack.be) -
[Leeuwarder Courant](https://www.lc.nl) -
[NRC Handelsblad](https://www.nrc.nl) -
[Parool](https://www.parool.nl) -

View file

@ -44,6 +44,7 @@ var allow_cookies = [
'independent.ie',
'inkl.com',
'intelligentinvestor.com.au',
'knack.be',
'lc.nl',
'lrb.co.uk',
'mexiconewsdaily.com',
@ -178,6 +179,7 @@ var blockedRegexes = {
'ilmessaggero.it': /(utils\.cedsdigital\.it\/js\/PaywallMeter\.js|static\.viralize\.tv\/viralize_player)/,
'independent.ie': /cdn\.flip-pay\.com\/clients\/inm\/flip-pay\.js/,
'inquirer.com': /.+\.tinypass\.com\/.+/,
'knack.be': /.+\.knack\.be\/js\/responsive\/rmgModal\.js/,
'ladepeche.fr': /.+\.poool\.fr\/.+/,
'lastampa.it': /.+\.repstatic\.it\/minify\/sites\/lastampa\/.+\/config\.cache\.php\?name=social_js/,
'lc.nl': /.+\.evolok\.net\/.+\/authorize\/.+/,

View file

@ -728,6 +728,20 @@ else if (matchDomain('slader.com')) {
}, 500); // Delay (in milliseconds)
}
else if (matchDomain('knack.be')) {
let paywall = document.querySelector('.rmgPaywall');
removeDOMElement(paywall);
let hidden_body = document.querySelector('div.rmgDetail-body div');
if (hidden_body) {
hidden_body.removeAttribute('class');
let body_text = hidden_body.innerText.replace(/(?:^|[\w\"\'])(\.|\?|!)(?=[A-Za-zÀ-ÿ\"\']{2,})/gm, "$&\n\n");
hidden_body.innerText = body_text;
let intro_par = document.querySelector('div.rmgDetail-body p');
if (intro_par && intro_par.innerText.length > 200)
removeDOMElement(intro_par);
}
}
// General Functions
function removeDOMElement(...elements) {
for (let element of elements) {

View file

@ -120,6 +120,7 @@
"*://*.irishtimes.com/*",
"*://*.japantimes.co.jp/*",
"*://*.journalnow.com/*",
"*://*.knack.be/*",
"*://*.labusinessjournal.com/*",
"*://*.ladepeche.fr/*",
"*://*.lanacion.com.ar/*",
@ -181,6 +182,7 @@
"*://*.seattletimes.com/*",
"*://*.seekingalpha.com/*",
"*://*.sfchronicle.com/*",
"*://*.slader.com/*",
"*://*.sloanreview.mit.edu/*",
"*://*.smh.com.au/*",
"*://*.sofrep.com/*",

View file

@ -68,6 +68,7 @@ var defaultSites =
"Inkl": "inkl.com",
"Intelligent Investor": "intelligentinvestor.com.au",
"Irish Independent": "independent.ie",
"Knack.be": "knack.be",
"L'Écho": "lecho.be",
"L'Opinion": "lopinion.fr",
"La Dépêche": "ladepeche.fr",