Add Irish Independent

This commit is contained in:
magnolia1234 2020-06-08 16:44:46 +02:00
parent 02f03905a8
commit 4d04b3f1fc
5 changed files with 26 additions and 17 deletions

View file

@ -150,6 +150,7 @@ Install add-on by downloading xpi-file.
##### 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) -

View file

@ -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/,

View file

@ -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++) {

View file

@ -3,17 +3,6 @@
"scripts": ["sites.js", "background.js"]
},
"content_security_policy": "script-src 'self'; object-src 'self'",
"content_scripts": [{
"matches": [
"*://*.bloomberg.com/*",
"*://*.economist.com/*",
"*://*.nytimes.com/*",
"*://*.theathletic.com/*",
"*://*.washingtonpost.com/*"
],
"js": ["contentScript.js"]
}
],
"applications": {
"gecko": {
"id": "magnolia_limited_permissions@12.34",
@ -123,6 +112,7 @@
"*://*.ilmanifesto.it/*",
"*://*.ilmessaggero.it/*",
"*://*.inc.com/*",
"*://*.independent.ie/*",
"*://*.inquirer.com/*",
"*://*.intelligentinvestor.com.au/*",
"*://*.irishtimes.com/*",
@ -244,7 +234,9 @@
"*://*.ampproject.org/*",
"*://*.cedsdigital.it/*",
"*://*.corriereobjects.it/*",
"*://*.emol.cl/*",
"*://*.epimg.net/*",
"*://*.flip-pay.com/*",
"*://*.htmedia.in/*",
"*://*.lightboxcdn.com/*",
"*://*.lp4.io/*",
@ -254,7 +246,6 @@
"*://*.repstatic.it/*",
"*://*.userzoom.com/*",
"*://*.viralize.tv/*",
"*://merreader.emol.cl/*",
"*://*.bndestem.nl/*",
"*://*.bd.nl/*",
"*://*.ed.nl/*",

View file

@ -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",