diff --git a/README.md b/README.md index 6b10f5b..d9de10b 100755 --- a/README.md +++ b/README.md @@ -179,6 +179,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall ##### United Kingdom/Ireland [Financial News](https://www.fnlondon.com) - [Financial Times](https://www.ft.com) - +[Irish Independent](https://www.independent.ie) - [London Review of Books](https://www.lrb.co.uk) - [The Athletic UK](https://theathletic.com) - [The Economist](https://www.economist.com) - diff --git a/background.js b/background.js index 71d7391..3dea683 100755 --- a/background.js +++ b/background.js @@ -41,6 +41,7 @@ var allow_cookies = [ 'handelsblatt.com', 'heraldsun.com.au', 'humo.be', +'independent.ie', 'intelligentinvestor.com.au', 'kleinezeitung.at', 'lc.nl', @@ -170,6 +171,7 @@ var blockedRegexes = { 'haaretz.com': /haaretz\.com\/hdc\/web\/js\/minified\/header-scripts-int.js.+/, 'historyextra.com': /.+\.evolok\.net\/.+\/authorize\/.+/, '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\/.+/, 'ladepeche.fr': /.+\.poool\.fr\/.+/, 'lastampa.it': /.+\.repstatic\.it\/minify\/sites\/lastampa\/.+\/config\.cache\.php\?name=social_js/, diff --git a/contentScript.js b/contentScript.js index 025077b..5d46862 100755 --- a/contentScript.js +++ b/contentScript.js @@ -71,7 +71,7 @@ else if (matchDomain('telegraaf.nl')) { removeDOMElement(article_body_old); let json = document.querySelector('script[type="application/ld+json"][data-react-helmet="true"]'); if (json) { - json_text = JSON.parse(json.text).articleBody; + var json_text = JSON.parse(json.text).articleBody; let article_body = document.querySelector('section.TextArticlePage__bodyText'); if (article_body) { let div_main = document.createElement("div"); @@ -540,8 +540,7 @@ else if (matchDomain('barrons.com')) { href = signin_links[i].href; if (href.includes('target=')) { href = href.split('target')[1].split('%3F')[0]; - href = href.replace('=', '').replace('%3A', ':'); - href = href.replace('%2F', '/').replace('%2F', '/').replace('%2F', '/').replace('%2F', '/'); + href = href.replace('=', '').replace('%3A', ':').replace(/%2F/g, '/'); signin_links[i].href = href; signin_links[i].text = 'Click'; } @@ -675,9 +674,9 @@ else if (matchDomain('spectator.co.uk')) { } else if (matchDomain('bostonglobe.com')) { - if (!document.cookie.split(';').some(function(item) { return item.trim().indexOf('s_fid=') === 0 })) { + if (!cookieExists('s_fid')) { let s_fid = genHexString(16) + '-' + genHexString(16); - document.cookie = "s_fid=" + s_fid + "; domain=bostonglobe.com; path=/; max-age=1209600"; + setCookie('s_fid', s_fid, 'bostonglobe.com', '/', 14); } } @@ -694,6 +693,12 @@ else if (matchDomain('historyextra.com')) { removeDOMElement(ad_banner); } +else if (matchDomain('independent.ie')) { + if (!cookieExists('subscriber')) { + setCookie('subscriber', '{"subscriptionStatus": true}', 'www.independent.ie', '/', 14); + } +} + // General Functions function removeDOMElement(...elements) { for (let element of elements) { @@ -720,6 +725,15 @@ function removeClassesByPrefix(el, prefix) { } } +function cookieExists(name) { + return document.cookie.split(';').some(function(item) { return item.trim().indexOf(name + '=') === 0 }) +} + +function setCookie(name, value, domain, path, days) { + var max_age = days * 24 * 60 * 60; + document.cookie = name + "=" + (value || "") + "; domain=" + domain + "; path=" + path + "; max-age=" + max_age; +} + function genHexString(len) { let output = ''; for (let i = 0; i < len; i++) { diff --git a/lp/manifest.json b/lp/manifest.json index 6789ed8..15f354f 100644 --- a/lp/manifest.json +++ b/lp/manifest.json @@ -100,6 +100,7 @@ "*://*.ilmanifesto.it/*", "*://*.ilmessaggero.it/*", "*://*.inc.com/*", + "*://*.independent.ie/*", "*://*.inquirer.com/*", "*://*.intelligentinvestor.com.au/*", "*://*.irishtimes.com/*", @@ -221,7 +222,9 @@ "*://*.ampproject.org/*", "*://*.cedsdigital.it/*", "*://*.corriereobjects.it/*", + "*://*.emol.cl/*", "*://*.epimg.net/*", + "*://*.flip-pay.com/*", "*://*.htmedia.in/*", "*://*.lightboxcdn.com/*", "*://*.lp4.io/*", @@ -231,7 +234,6 @@ "*://*.repstatic.it/*", "*://*.userzoom.com/*", "*://*.viralize.tv/*", - "*://merreader.emol.cl/*", "*://*.bndestem.nl/*", "*://*.bd.nl/*", "*://*.ed.nl/*", diff --git a/sites.js b/sites.js index aeac252..e69787d 100644 --- a/sites.js +++ b/sites.js @@ -64,6 +64,7 @@ var defaultSites = "Il Messaggero": "ilmessaggero.it", "Illawarra Mercury": "illawarramercury.com.au", "Intelligent Investor": "intelligentinvestor.com.au", + "Irish Independent": "independent.ie", "Kleine Zeitung": "kleinezeitung.at", "L'Écho": "lecho.be", "L'Opinion": "lopinion.fr",