diff --git a/README.md b/README.md index 3cc5452..4697163 100644 --- a/README.md +++ b/README.md @@ -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) - diff --git a/background.js b/background.js index 809015e..79195f9 100644 --- a/background.js +++ b/background.js @@ -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\/.+/, diff --git a/contentScript.js b/contentScript.js index 12d3868..0eb2f0e 100644 --- a/contentScript.js +++ b/contentScript.js @@ -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) { diff --git a/lp/manifest.json b/lp/manifest.json index 7695ee6..8e8957a 100644 --- a/lp/manifest.json +++ b/lp/manifest.json @@ -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/*", diff --git a/sites.js b/sites.js index 7b0b0e5..b62c74a 100644 --- a/sites.js +++ b/sites.js @@ -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",