Fix The Hill Times (css)

merge-requests/16/head
magnolia1234 8 months ago
parent aaddacb65d
commit 8ff42efe7e

@ -10,6 +10,7 @@ Fix Groupe La Depeche (json)
Fix Mediahuis Noord (json)
Fix Mexico News Daily
Fix New Scientist (text-break)
Fix The Hill Times (css)
Update amp-redirect (disable loop)
Update custom sites (import - remove obsolete)

@ -152,7 +152,7 @@ if (bg2csData.ld_json_url && dompurify_loaded) {
let article_append = ld_json_url_split[2]; // optional
if (paywall.length && article) {
removeDOMElement(...paywall);
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -203,7 +203,7 @@ if (bg2csData.add_ext_link) {
window.setTimeout(function () {
let url = window.location.href.split(/[#\?]/)[0];
if (matchUrlDomain('zeit.de', url)) {
if (document.querySelector('link[rel="next"]'))
if (document.querySelector('head > link[rel="next"]'))
url += '/komplettansicht';
}
let add_ext_link_split = bg2csData.add_ext_link.css.split('|');
@ -365,7 +365,7 @@ if (matchDomain('crikey.com.au')) {
let paywall = document.querySelector('div.locked-content');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -1193,13 +1193,16 @@ else if (matchDomain('vol.at')) {
}
else if (matchDomain('zeit.de')) {
let url = window.location.href;
let url = window.location.href.split(/[#\?]/)[0];
let paywall = document.querySelector('aside#paywall');
if (paywall) {
removeDOMElement(paywall);
let article = document.querySelector('div.article-body');
if (article)
if (article) {
if (document.querySelector('head > link[rel="next"]'))
url += '/komplettansicht';
article.firstChild.before(archiveLink(url));
}
let fade = document.querySelector('div.paragraph--faded');
if (fade)
fade.classList.remove('paragraph--faded');
@ -1242,7 +1245,7 @@ else if (matchDomain(de_funke_medien_domains) || document.querySelector('a[href=
sessionStorage.setItem('deobfuscate', 'true');
}
else if (matchDomain(de_madsack_domains) || document.querySelector('link[href*=".rndtech.de/"]')) {
else if (matchDomain(de_madsack_domains) || document.querySelector('head > link[href*=".rndtech.de/"]')) {
// plus code in contentScript_once_var.js (timing)
if (!window.location.search.startsWith('?outputType=valid_amp')) {
let ads = document.querySelectorAll('div[class^="Adstyled__AdWrapper"]');
@ -1256,7 +1259,7 @@ else if (matchDomain('ruhrnachrichten.de') || document.querySelector('a.mgw-logo
let paywall = document.querySelector('body.is_plus_article');
if (paywall && dompurify_loaded) {
paywall.classList.remove('is_plus_article');
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -1644,9 +1647,9 @@ else if (matchDomain(fr_groupe_la_depeche_domains)) {
if (json_script) {
try {
let json = JSON.parse(json_script.text);
if (json[0])
json = json[0];
if (json) {
if (json[0])
json = json[0];
let json_text = parseHtmlEntities(json.articleBody);
let content = document.querySelector('div.article-full__body-content');
if (json_text && content) {
@ -2309,7 +2312,7 @@ else if (matchDomain(be_roularta_domains)) {
hideDOMElement(...ads);
}
else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('link[href*=".ndcmediagroep.nl/"]')) {
else if (matchDomain(['lc.nl', 'dvhn.nl']) || document.querySelector('head > link[href*=".ndcmediagroep.nl/"]')) {
let paywall = document.querySelector('div.signupPlus, div.pw-wrapper');
if (paywall && dompurify_loaded) {
let intro = document.querySelector('div.startPayWall');
@ -2672,7 +2675,7 @@ else if (matchDomain('vn.nl')) {
let article_content = document.querySelector('section[data-article-content-element]');
if (article_content)
article_content.style = 'max-height:none !important;';
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -3047,7 +3050,7 @@ else if (matchDomain('the-tls.co.uk')) {
let paywall = document.querySelector('.tls-single-article__closed-paywall');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -3901,24 +3904,36 @@ else if (matchDomain('hbr.org')) {
}
else if (matchDomain('hilltimes.com')) {
let paywall = document.querySelectorAll('div[class^="paywallcont"]');
if (paywall.length) {
removeDOMElement(...paywall);
function hilltimes_main(node) {
let paywall_banner = document.querySelector('div.paywallcont2');
removeDOMElement(node, paywall_banner);
let json_script = document.querySelector('script.saswp-schema-markup-output');
if (json_script) {
try {
let json = JSON.parse(json_script.text);
json_text = json.filter(x => x.articleBody)[0].articleBody.replace(/\s{2,}/g, '\r\n\r\n');
let json_text = json.filter(x => x.articleBody)[0].articleBody.replace(/\s{2,}/g, '\r\n\r\n');
let article = document.querySelector('div#fadebg > p');
if (article)
if (article) {
article.innerText = parseHtmlEntities(json_text);
article.parentNode.removeAttribute('id');
}
} catch (err) {
console.log(err);
}
}
}
let banner = document.querySelector('section.hide_this_section');
hideDOMElement(banner);
let paywall_sel = 'div.paywallcont';
let paywall = document.querySelector(paywall_sel);
if (paywall) {
hilltimes_main(paywall);
} else {
waitDOMElement(paywall_sel, 'DIV', hilltimes_main, false);
}
csDoneOnce = true;
window.setTimeout(function () {
let banner = document.querySelector('section.hide_this_section');
hideDOMElement(banner);
}, 1000);
}
else if (matchDomain('hindustantimes.com')) {
@ -4386,7 +4401,7 @@ else if (matchDomain('puck.news')) {
let paywall = document.querySelectorAll('div[class*="paywall"]');
if (paywall.length && dompurify_loaded) {
removeDOMElement(...paywall);
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -4589,7 +4604,7 @@ else if (matchDomain('stereogum.com')) {
let paywall = document.querySelector('div.members-only-overlay-wrapper');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -4713,7 +4728,7 @@ else if (matchDomain('theamericanconservative.com')) {
let paywall = document.querySelector('section.c-blog-post__body--locked');
if (paywall && dompurify_loaded) {
paywall.classList.remove('c-blog-post__body--locked');
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -4750,7 +4765,7 @@ else if (matchDomain('theamericanconservative.com')) {
}
else if (matchDomain('theathletic.com')) {
if (!(window.location.search.match(/(\?|&)amp/) && !document.querySelector('link[rel="amphtml"]'))) {
if (!(window.location.search.match(/(\?|&)amp/) && !document.querySelector('head > link[rel="amphtml"]'))) {
function theathletic_func(node) {
removeDOMElement(node);
let overlays = document.querySelectorAll('div[id*="overlay"], div:empty:not([data-rjs])');
@ -5188,7 +5203,7 @@ else if (matchDomain('thewrap.com')) {
let paywall = document.querySelector('div#zephr-payment-form-root');
if (paywall && dompurify_loaded) {
removeDOMElement(paywall);
let json_url_dom = document.querySelector('link[rel="alternate"][type="application/json"][href]');
let json_url_dom = document.querySelector('head > link[rel="alternate"][type="application/json"][href]');
if (json_url_dom) {
let json_url = json_url_dom.href;
fetch(json_url)
@ -5838,7 +5853,7 @@ function amp_unhide_access_hide(amp_access = '', amp_access_not = '', amp_ads_se
function ampToHtml() {
window.setTimeout(function () {
let canonical = document.querySelector('link[rel="canonical"]');
let canonical = document.querySelector('head > link[rel="canonical"]');
window.location.href = canonical.href;
}, 1000);
}

@ -52,7 +52,7 @@ window.setTimeout(function () {
if (matchDomain(['gva.be', 'hbvl.be', 'nieuwsblad.be', 'standaard.be']))
group = '###_be_mediahuis';// no fix
} else if (hostname.endsWith('.cl')) {
if (document.querySelector('meta[property="og:image"][content*="/impresa.soy-chile.cl/"]'))
if (document.querySelector('head > meta[property="og:image"][content*="/impresa.soy-chile.cl/"]'))
group = 'elmercurio.com';
} else if (hostname.match(/\.(de|at|ch)$/) || matchDomain(['horizont.net', 'lebensmittelzeitung.net'])) {
if (document.querySelector('script[src*="/dfv.containers.piwik.pro/"]'))
@ -61,7 +61,7 @@ window.setTimeout(function () {
group = '###_de_funke_medien';
else if (document.querySelector('div.navigation__personalization > a[href^="https://www.haas-mediengruppe.de/"]'))
group = '###_de_haas_medien';
else if (document.querySelector('link[href*=".rndtech.de/"]'))
else if (document.querySelector('head > link[href*=".rndtech.de/"]'))
group = '###_de_madsack';
else if (document.querySelector('a.mgw-logo[href^="https://mgw.de"]'))
group = '###_de_mgw';
@ -71,30 +71,30 @@ window.setTimeout(function () {
group = '###_de_rp_aachen_medien';// no fix
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']))
group = '###_de_vrm';
else if (document.querySelector('link[href*="/assets.static-chmedia.ch/"]'))
else if (document.querySelector('head > link[href*="/assets.static-chmedia.ch/"]'))
group = 'nzz.ch';
else if (document.querySelector('link[href*=".tamedia.ch/"]'))
else if (document.querySelector('head > link[href*=".tamedia.ch/"]'))
group = '###_ch_tamedia';// no fix
} else if (hostname.match(/\.(es|cat)$/) || matchDomain(['diariocordoba.com', 'elperiodicodearagon.com', 'elperiodicoextremadura.com', 'elperiodicomediterraneo.com', 'emporda.info'])) {
if (document.querySelector('link[href*="/estaticos-cdn."]'))
if (document.querySelector('head > link[href*="/estaticos-cdn."]'))
group = '###_es_epiberica';
else if (document.querySelector('div > ul > li > a[href="https://www.sportlife.es/"]'))
group = '###_es_sport_life';
} else if (hostname.endsWith('.fi')) {
if (document.querySelector('link[href^="https://assets.almatalent.fi"]'))
if (document.querySelector('head > link[href^="https://assets.almatalent.fi"]'))
group = '###_fi_alma_talent';// no fix
} else if (hostname.endsWith('.fr')) {
if (document.querySelector('link[href*=".fr/static/bloc/ripolinage/header/cf-header/"]'))
if (document.querySelector('head > link[href*=".fr/static/bloc/ripolinage/header/cf-header/"]'))
group = '###_fr_gcf';
} else if (hostname.endsWith('.it')) {
if (document.querySelector('link[href^="//citynews.stgy.ovh/"]'))
if (document.querySelector('head > link[href^="//citynews.stgy.ovh/"]'))
group = '###_it_citynews';// no fix
else if (matchDomain(['gazzettadimodena.it', 'gazzettadireggio.it', 'lanuovaferrara.it']))
group = '###_it_gruppo_sae';
} else if (hostname.endsWith('.nl')) {
if (document.querySelector('link[href*=".ndcmediagroep.nl/"]'))
if (document.querySelector('head > link[href*=".ndcmediagroep.nl/"]'))
group = '###_nl_mediahuis_noord';
else if (document.querySelector('link[rel="dns-prefetch"][href^="https://vmn-"][href$="imgix.net"]'))
else if (document.querySelector('head > link[rel="dns-prefetch"][href^="https://vmn-"][href$="imgix.net"]'))
group = '###_nl_vmnmedia';// no fix
} else if (hostname.endsWith('.se')) {
if (document.querySelector('footer > div > div > a[href="https://www.nwtmedia.se/"]'))
@ -107,7 +107,7 @@ window.setTimeout(function () {
} else if (hostname.match(/\.(ca|com|net|news|org)$/)) {
if (document.querySelector('picture > source[srcset*="%2Fgcm.omerlocdn.com%2F"]'))
group = '###_ca_gcm';
else if (document.querySelector('script[src*=".postmedia.digital/"], meta[content*=".postmedia.digital/"]'))
else if (document.querySelector('script[src*=".postmedia.digital/"], head > meta[content*=".postmedia.digital/"]'))
group = '###_ca_postmedia';
else if (document.querySelector('script[src*=".axate.io/"], script[src*=".agate.io/"]'))
group = '###_uk_axate.io';
@ -115,7 +115,7 @@ window.setTimeout(function () {
group = '###_uk_incisive_media';
else if (document.querySelector('script[src="https://cdn.blueconic.net/bridgetowermedia.js"], header.site-header > div.btm-header'))
group = '###_usa_bridge_tower';
else if (document.querySelector('img[srcset^="https://www.gannett-cdn.com/"], link[href*=".gannett-cdn.com/"]'))
else if (document.querySelector('img[srcset^="https://www.gannett-cdn.com/"], head > link[href*=".gannett-cdn.com/"]'))
group = '###_usa_gannett';
else if (document.querySelector('script[src*="/treg.hearstnp.com/"]'))
group = '###_usa_hearst_comm';
@ -123,14 +123,14 @@ window.setTimeout(function () {
group = '###_usa_lee_ent';
else if (document.querySelector('script[src*=".townnews.com/"][src*="/tncms/"]'))
group = '###_usa_townnews';
else if (document.querySelector('meta[content^="https://www.mcclatchy-wires.com/"], a[href^="https://classifieds.mcclatchy.com/"], script[src*=".mcclatchyinteractive.com/"]'))
else if (document.querySelector('head > meta[content^="https://www.mcclatchy-wires.com/"], a[href^="https://classifieds.mcclatchy.com/"], script[src*=".mcclatchyinteractive.com/"]'))
group = '###_usa_mcc';
else if (document.querySelector('script[src*="/wp-content/plugins/dfm"], amp-img#paywall[src*=".com/wp-content/plugins/dfm-amp-mods/"]'))
group = '###_usa_mng';
else if (hostname.match(/\.com$/)) {
if (matchDomain(['journalauto.com', 'journaldupneu.com', 'j2rauto.com']))
group = '###_fr_synerj';
else if (document.querySelector('link[href*=".com/wp-content/themes/madavor/"]'))
else if (document.querySelector('head > link[href*=".com/wp-content/themes/madavor/"]'))
group = '###_usa_madavor';
else if (document.querySelector('img[data-src*="/wp-content/plugins/pragmatic-pei-rebranding/"]'))
group = '###_usa_pei';

Loading…
Cancel
Save