2022-12-07 13:14:32 +01:00
|
|
|
//'use strict';
|
|
|
|
var ext_api = (typeof browser === 'object') ? browser : chrome;
|
2021-06-30 18:20:20 +02:00
|
|
|
|
2022-11-05 15:09:46 +01:00
|
|
|
if (matchDomain('gitlab.com')) {
|
2022-03-17 19:39:21 +01:00
|
|
|
window.setTimeout(function () {
|
2023-03-14 17:00:17 +01:00
|
|
|
let bio = document.querySelector('p.profile-user-bio');
|
2022-03-17 19:39:21 +01:00
|
|
|
if (bio) {
|
|
|
|
let split = bio.innerText.split(/(https:[\w\-/.]+)|\|/g).filter(x => x && x.trim());
|
|
|
|
bio.innerText = '';
|
|
|
|
for (let part of split) {
|
|
|
|
let elem;
|
|
|
|
if (part.startsWith('https')) {
|
|
|
|
elem = document.createElement('a');
|
|
|
|
elem.innerText = part;
|
|
|
|
elem.href = part;
|
|
|
|
elem.appendChild(document.createElement('br'));
|
|
|
|
} else {
|
|
|
|
elem = document.createElement('b');
|
|
|
|
elem.appendChild(document.createTextNode(part));
|
|
|
|
if (!part.includes(':'))
|
|
|
|
elem.appendChild(document.createElement('br'));
|
|
|
|
}
|
|
|
|
bio.appendChild(elem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, 1000);
|
2021-09-05 18:47:28 +02:00
|
|
|
}
|
|
|
|
|
2022-12-07 13:14:32 +01:00
|
|
|
else {
|
|
|
|
window.setTimeout(function () {
|
|
|
|
|
|
|
|
let hostname = window.location.hostname;
|
2022-12-14 08:30:03 +01:00
|
|
|
let custom_domain = getCookieDomain(hostname);
|
2022-12-07 13:14:32 +01:00
|
|
|
let group;
|
|
|
|
if (hostname) {
|
2022-12-14 08:30:03 +01:00
|
|
|
if (document.querySelector('script[src*=".medium.com/"]') || matchDomain(['plainenglish.io']))
|
2023-07-14 11:10:22 +02:00
|
|
|
group = 'medium.com';
|
2023-12-28 13:09:10 +01:00
|
|
|
else if (document.querySelector('head > link[href*="/leaky-paywall"], script[src*="/leaky-paywall"], div[id^="issuem-leaky-paywall-"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_wp_leaky_paywall';
|
|
|
|
else if (document.querySelector('script[src*="/substackcdn.com/"], link[rel="stylesheet"][href*="/substackcdn.com/"]'))
|
2023-05-17 18:14:27 +02:00
|
|
|
group = '###_substack_custom';// no fix
|
2023-04-16 14:41:01 +02:00
|
|
|
else if (document.querySelector('script[src*="/wp-content/themes/pmgnews/scripts/promedia.js"], form[action^="https://go.promedia.nl/"]'))
|
|
|
|
group = '###_nl_promedia';
|
2023-12-06 19:19:00 +01:00
|
|
|
else if (hostname.match(/\.com$/) && !matchDomain(['campaignlive.com']) && document.querySelector('span#hmn-logo > a[href="https://www.haymarketmedicalnetwork.com/about"], footer a[href="https://www.haymarketmediaus.com/haymarket-media-inc-privacy-policy/"]'))
|
2023-11-06 19:48:00 +01:00
|
|
|
group = '###_uk_haymarket_medical';
|
|
|
|
else if (matchDomain(['asianinvestor.net', 'campaignindia.in', 'taspo.de']) || (hostname.match(/\.co(m|\.uk)$/) && document.querySelector('footer a[href^="http://www.haymarket.com"]')))
|
|
|
|
group = '###_uk_haymarket';
|
2023-11-04 11:57:32 +01:00
|
|
|
else if (matchDomain(['epochtimes-romania.com']) || hostname.match(/\.epochtimes\.(cz|de|fr|jp)/))
|
|
|
|
group = '###_usa_epochtimes';
|
2023-10-22 15:37:11 +02:00
|
|
|
else if (hostname.match(/\.(com|net)\.au$/) && !matchDomain(['insideretail.com.au'])) {
|
2023-07-21 17:04:27 +02:00
|
|
|
if (document.querySelector('a[href^="https://austcommunitymedia.my.site.com/"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_au_comm_media';
|
|
|
|
else if (hostname.endsWith('.com.au')) {
|
2023-02-08 16:58:13 +01:00
|
|
|
if (document.querySelector('li > a[href*=".sevenwestmedia.com.au"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = 'thewest.com.au';
|
2024-02-03 09:55:17 +01:00
|
|
|
else (document.querySelector('head > link[rel="dns-prefetch"][href="//static.ew.mmg.navigacloud.com"]'))
|
|
|
|
group = '###_au_mmg';
|
2022-12-07 13:14:32 +01:00
|
|
|
}
|
|
|
|
} else if (hostname.endsWith('.cl')) {
|
2023-09-30 13:28:40 +02:00
|
|
|
if (document.querySelector('head > meta[property="og:image"][content*="/impresa.soy-chile.cl/"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = 'elmercurio.com';
|
2023-01-08 09:35:56 +01:00
|
|
|
} else if (hostname.match(/\.(de|at|ch)$/) || matchDomain(['horizont.net', 'lebensmittelzeitung.net'])) {
|
2023-07-24 18:33:33 +02:00
|
|
|
if (document.querySelector('script[src*="/dfv.containers.piwik.pro/"]'))
|
|
|
|
group = '###_de_dfv_medien';
|
2023-04-03 17:52:09 +02:00
|
|
|
else if (document.querySelector('div.navigation__personalization > a[href^="https://www.haas-mediengruppe.de/"]'))
|
|
|
|
group = '###_de_haas_medien';
|
2023-09-30 13:28:40 +02:00
|
|
|
else if (document.querySelector('head > link[href*=".rndtech.de/"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_de_madsack';
|
2023-08-24 12:39:56 +02:00
|
|
|
else if (document.querySelector('a.mgw-logo[href^="https://mgw.de"]'))
|
2023-07-24 18:33:33 +02:00
|
|
|
group = '###_de_mgw';
|
2023-11-11 10:30:18 +01:00
|
|
|
else if (matchDomain(['cannstatter-zeitung.de', 'esslinger-zeitung.de', 'frankenpost.de', 'insuedthueringen.de', 'krzbb.de', 'kurier.de', 'np-coburg.de']))
|
2023-07-24 18:33:33 +02:00
|
|
|
group = '###_de_mhs';
|
2023-07-21 10:41:57 +02:00
|
|
|
else if (matchDomain(['buerstaedter-zeitung.de', 'hochheimer-zeitung.de', 'lampertheimer-zeitung.de', 'lauterbacher-anzeiger.de', 'main-spitze.de', 'mittelhessen.de', 'oberhessische-zeitung.de', 'wormser-zeitung.de']))
|
2023-02-05 14:25:33 +01:00
|
|
|
group = '###_de_vrm';
|
2023-09-30 13:28:40 +02:00
|
|
|
else if (document.querySelector('head > link[href*="/assets.static-chmedia.ch/"]'))
|
2024-02-13 12:14:07 +01:00
|
|
|
group = '###_ch_media';
|
2023-09-30 13:28:40 +02:00
|
|
|
else if (document.querySelector('head > link[href*=".tamedia.ch/"]'))
|
2024-01-28 10:55:09 +01:00
|
|
|
group = '###_ch_tamedia';// custom
|
2022-12-07 13:14:32 +01:00
|
|
|
} else if (hostname.match(/\.(es|cat)$/) || matchDomain(['diariocordoba.com', 'elperiodicodearagon.com', 'elperiodicoextremadura.com', 'elperiodicomediterraneo.com', 'emporda.info'])) {
|
2023-09-30 13:28:40 +02:00
|
|
|
if (document.querySelector('head > link[href*="/estaticos-cdn."]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_es_epiberica';
|
2023-03-26 14:38:58 +02:00
|
|
|
else if (document.querySelector('div > ul > li > a[href="https://www.sportlife.es/"]'))
|
|
|
|
group = '###_es_sport_life';
|
2023-02-03 13:29:41 +01:00
|
|
|
} else if (hostname.endsWith('.fi')) {
|
2023-09-30 13:28:40 +02:00
|
|
|
if (document.querySelector('head > link[href^="https://assets.almatalent.fi"]'))
|
2023-02-03 13:29:41 +01:00
|
|
|
group = '###_fi_alma_talent';// no fix
|
2022-12-07 13:14:32 +01:00
|
|
|
} else if (hostname.endsWith('.fr')) {
|
2023-12-18 17:07:34 +01:00
|
|
|
if (document.querySelector('head > meta[name="google-play-app"][content^="app-id=com.centrefrance"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_fr_gcf';
|
2023-01-17 12:16:38 +01:00
|
|
|
} else if (hostname.endsWith('.it')) {
|
2023-09-30 13:28:40 +02:00
|
|
|
if (document.querySelector('head > link[href^="//citynews.stgy.ovh/"]'))
|
2023-01-17 12:16:38 +01:00
|
|
|
group = '###_it_citynews';// no fix
|
2023-05-18 08:22:47 +02:00
|
|
|
else if (matchDomain(['gazzettadimodena.it', 'gazzettadireggio.it', 'lanuovaferrara.it']))
|
|
|
|
group = '###_it_gruppo_sae';
|
2022-12-07 13:14:32 +01:00
|
|
|
} else if (hostname.endsWith('.nl')) {
|
2023-09-30 13:28:40 +02:00
|
|
|
if (document.querySelector('head > link[href*=".ndcmediagroep.nl/"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_nl_mediahuis_noord';
|
2023-09-30 13:28:40 +02:00
|
|
|
else if (document.querySelector('head > link[rel="dns-prefetch"][href^="https://vmn-"][href$="imgix.net"]'))
|
2023-07-13 07:41:38 +02:00
|
|
|
group = '###_nl_vmnmedia';// no fix
|
2023-07-03 16:18:24 +02:00
|
|
|
} else if (hostname.endsWith('.se')) {
|
|
|
|
if (document.querySelector('footer > div > div > a[href="https://www.nwtmedia.se/"]'))
|
|
|
|
group = '###_se_nwt_media';
|
2023-02-17 18:19:29 +01:00
|
|
|
} else if (hostname.endsWith('.co.uk')) {
|
|
|
|
if (document.querySelector('footer > div a[href^="https://www.nationalworldplc.com"]'))
|
|
|
|
group = '###_uk_nat_world';
|
2023-09-21 20:55:33 +02:00
|
|
|
else if (matchDomain(['investmentweek.co.uk']))
|
|
|
|
group = '###_uk_incisive_media';
|
2023-03-27 18:54:50 +02:00
|
|
|
} else if (hostname.match(/\.(ca|com|net|news|org)$/)) {
|
2024-01-25 18:04:30 +01:00
|
|
|
if (matchDomain(['latribune.ca', 'lavoixdelest.ca', 'ledroit.com', 'lenouvelliste.ca', 'lequotidien.com']))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_ca_gcm';
|
2023-09-30 13:28:40 +02:00
|
|
|
else if (document.querySelector('script[src*=".postmedia.digital/"], head > meta[content*=".postmedia.digital/"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_ca_postmedia';
|
2023-10-24 08:08:45 +02:00
|
|
|
else if (document.querySelector('script[src*=".axate.io/"], script[src*=".agate.io/"]'))
|
2022-12-23 15:48:26 +01:00
|
|
|
group = '###_uk_axate.io';
|
2023-12-06 19:19:00 +01:00
|
|
|
else if (matchDomain(['businessgreen.com', 'internationalinvestment.net', 'professionaladviser.com', 'professionalpensions.com']))
|
2023-09-21 20:55:33 +02:00
|
|
|
group = '###_uk_incisive_media';
|
2023-08-26 15:52:41 +02:00
|
|
|
else if (document.querySelector('script[src="https://cdn.blueconic.net/bridgetowermedia.js"], header.site-header > div.btm-header'))
|
|
|
|
group = '###_usa_bridge_tower';
|
2024-02-16 08:46:26 +01:00
|
|
|
else if (document.querySelector('head > link[href*=".gannettdigital.com/"], head > link[href*=".gannett-cdn.com/"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_usa_gannett';
|
|
|
|
else if (document.querySelector('script[src*="/treg.hearstnp.com/"]'))
|
|
|
|
group = '###_usa_hearst_comm';
|
|
|
|
else if (document.querySelector('script[src*=".townnews.com/"][src*="leetemplates.com/'))
|
|
|
|
group = '###_usa_lee_ent';
|
|
|
|
else if (document.querySelector('script[src*=".townnews.com/"][src*="/tncms/"]'))
|
|
|
|
group = '###_usa_townnews';
|
2023-09-30 13:28:40 +02:00
|
|
|
else if (document.querySelector('head > meta[content^="https://www.mcclatchy-wires.com/"], a[href^="https://classifieds.mcclatchy.com/"], script[src*=".mcclatchyinteractive.com/"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_usa_mcc';
|
2024-01-10 11:02:03 +01:00
|
|
|
else if (document.querySelector('head > link[rel="stylesheet"][id^="dfm-accuweather-"], footer li > a[href^="https://www.medianewsgroup.com"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_usa_mng';
|
|
|
|
else if (hostname.match(/\.com$/)) {
|
2023-06-25 19:26:42 +02:00
|
|
|
if (matchDomain(['journalauto.com', 'journaldupneu.com', 'j2rauto.com']))
|
|
|
|
group = '###_fr_synerj';
|
2023-11-02 22:09:20 +01:00
|
|
|
else if (!matchDomain('institutionalinvestor.com') && (matchDomain('thedeal.com') || document.querySelector('footer.Page-footer a.Link[href="https://www.delinian.com/privacy-policy"]')))
|
|
|
|
group = '###_uk_delinian';// no fix
|
2024-01-06 11:43:08 +01:00
|
|
|
else if (document.querySelector('head > meta[property][content^="https://cdn.forumcomm.com/"]'))
|
|
|
|
group = '###_usa_forum_comm';
|
2023-12-22 15:36:24 +01:00
|
|
|
else if (document.querySelector('li > a[href^="https://www.bnpmedia.com/"]'))
|
|
|
|
group = '###_usa_bnp_media';
|
2023-10-21 09:05:42 +02:00
|
|
|
else if (matchDomain(['centralmaine.com', 'pressherald.com', 'sunjournal.com']))
|
|
|
|
group = '###_usa_maine_trust';
|
2023-12-31 11:50:28 +01:00
|
|
|
else if (document.querySelector('head > meta[name="peim_article_access_type"]'))
|
2022-12-07 13:14:32 +01:00
|
|
|
group = '###_usa_pei';
|
2023-04-21 15:40:41 +02:00
|
|
|
else if (matchDomain(['dayton.com', 'daytondailynews.com', 'journal-news.com', 'springfieldnewssun.com']))
|
|
|
|
group = 'ajc.com';// Cox First Media
|
2023-05-03 08:32:15 +02:00
|
|
|
else if (matchDomain(['accountingtoday.com', 'benefitnews.com', 'bondbuyer.com', 'dig-in.com', 'financial-planning.com', 'nationalmortgagenews.com']))
|
|
|
|
group = 'americanbanker.com';// Arizent
|
2022-12-07 13:14:32 +01:00
|
|
|
}
|
2023-10-22 15:37:11 +02:00
|
|
|
} else {
|
|
|
|
if (matchDomain(['insideretail.asia', 'insideretail.co.nz' ,'insideretail.com.au', 'insideretail.us']))
|
|
|
|
group = '###_au_inside_retail';
|
2022-12-07 13:14:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ext_api.runtime.sendMessage({
|
|
|
|
request: 'custom_domain',
|
|
|
|
data: {
|
|
|
|
domain: custom_domain,
|
|
|
|
group: group
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
|
2021-06-30 18:20:20 +02:00
|
|
|
function matchDomain(domains, hostname) {
|
|
|
|
var matched_domain = false;
|
|
|
|
if (!hostname)
|
|
|
|
hostname = window.location.hostname;
|
|
|
|
if (typeof domains === 'string')
|
|
|
|
domains = [domains];
|
|
|
|
domains.some(domain => (hostname === domain || hostname.endsWith('.' + domain)) && (matched_domain = domain));
|
|
|
|
return matched_domain;
|
|
|
|
}
|
2022-11-24 17:30:56 +01:00
|
|
|
|
2022-12-14 08:30:03 +01:00
|
|
|
function getCookieDomain(hostname) {
|
|
|
|
let domain = hostname;
|
|
|
|
let n = 0;
|
|
|
|
let parts = hostname.split('.');
|
|
|
|
let str = '_gd' + (new Date()).getTime();
|
2023-01-12 19:18:09 +01:00
|
|
|
try {
|
2022-12-14 08:30:03 +01:00
|
|
|
while (n < (parts.length - 1) && document.cookie.indexOf(str + '=' + str) == -1) {
|
|
|
|
domain = parts.slice(-1 - (++n)).join('.');
|
|
|
|
document.cookie = str + "=" + str + ";domain=" + domain + ";";
|
|
|
|
}
|
|
|
|
document.cookie = str + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=" + domain + ";";
|
2023-01-12 19:18:09 +01:00
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
2022-12-14 08:30:03 +01:00
|
|
|
return domain;
|
2022-12-07 13:14:32 +01:00
|
|
|
}
|