diff --git a/changelog.txt b/changelog.txt index cb262ed..33e2cb9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,7 @@ Add RedaktionsNetzwerk Deutschland Fix Alma Talent sites (js-ads) Fix Australia News Corp (amp) Fix Madsack Mediengruppe +Fix NzHerald * v2.6.2.0 (2022-03-27) Add Badische Neueste Nachrichten diff --git a/contentScript.js b/contentScript.js index e9aeb02..99e6324 100755 --- a/contentScript.js +++ b/contentScript.js @@ -33,7 +33,7 @@ var usa_outside_mag_domains = ["backpacker.com", "betamtb.com", "cleaneatingmag. var usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; // clean local storage of sites (with an exemption for hold-list) -var arr_localstorage_hold = ['abc.es', 'allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'barrons.com', 'businessoffashion.com', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'freiepresse.de', 'ilfoglio.it', 'inc42.com', 'kurier.at', 'lanouvellerepublique.fr', 'lesechos.fr', 'mid-day.com', 'muensterschezeitung.de', 'nknews.org', 'nytimes.com', 'scmp.com', 'seekingalpha.com', 'telegraph.co.uk', 'thehindu.com', 'thetimes.co.uk', 'westfalen-blatt.de', 'wn.de', 'wsj.com'].concat(de_funke_media_domains, es_epiberica_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, it_quotidiano_domains, no_nhst_media_domains, usa_hearst_comm_domains); +var arr_localstorage_hold = ['abc.es', 'allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'barrons.com', 'businessoffashion.com', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'freiepresse.de', 'ilfoglio.it', 'inc42.com', 'kurier.at', 'lanouvellerepublique.fr', 'lesechos.fr', 'mid-day.com', 'muensterschezeitung.de', 'nknews.org', 'nytimes.com', 'nzherald.co.nz', 'scmp.com', 'seekingalpha.com', 'telegraph.co.uk', 'thehindu.com', 'thetimes.co.uk', 'westfalen-blatt.de', 'wn.de', 'wsj.com'].concat(de_funke_media_domains, es_epiberica_domains, es_grupo_vocento_domains, es_unidad_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, fr_groupe_nice_matin_domains, it_quotidiano_domains, no_nhst_media_domains, usa_hearst_comm_domains); if (!matchDomain(arr_localstorage_hold)) { window.localStorage.clear(); } @@ -3023,10 +3023,13 @@ else if (matchDomain(['nola.com', 'theadvocate.com'])) { } else if (matchDomain('nzherald.co.nz')) { + // plus code in contentScript_once.js let article_content = document.querySelector('.article__content'); if (article_content) { - let article_offer = document.querySelector('.article-offer'); - if (article_offer && dompurify_loaded) { + let premium = document.querySelector('span.ellipsis'); + if (premium && dompurify_loaded) { + premium.classList.remove('ellipsis'); + let article_offer = document.querySelector('.article-offer'); removeDOMElement(article_offer); let css_selector = article_content.querySelectorAll('p[style]')[1].getAttribute('class'); let hidden_not_pars = article_content.querySelectorAll('.' + css_selector + ':not(p)'); diff --git a/contentScript_once.js b/contentScript_once.js index ae18b4d..9c2e3f4 100644 --- a/contentScript_once.js +++ b/contentScript_once.js @@ -61,6 +61,16 @@ else if (matchDomain('nyteknik.se')) { }, 2000); } +else if (matchDomain('nzherald.co.nz')) { + function nzherald_main() { + if (window.Fusion) + window.Fusion.globalContent.isPremium = false; + } + window.setTimeout(function () { + insert_script(nzherald_main); + }, 100); +} + else if (matchDomain('gitlab.com')) { window.setTimeout(function () { let bio = document.querySelector('div.profile-user-bio'); @@ -120,4 +130,15 @@ function waitDOMElement(selector, tagName = '', callback, multiple = false) { subtree: true, childList: true }); -} \ No newline at end of file +} + +function insert_script(func, insertAfterDom) { + let bpc_script = document.querySelector('script#bpc_script'); + if (!bpc_script) { + let script = document.createElement('script'); + script.setAttribute('id', 'bpc_script'); + script.appendChild(document.createTextNode('(' + func + ')();')); + let insertAfter = insertAfterDom ? insertAfterDom : (document.body || document.head || document.documentElement); + insertAfter.appendChild(script); + } +} diff --git a/custom/manifest.json b/custom/manifest.json index df0fb09..6edb72b 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -27,6 +27,7 @@ "*://*.inkl.com/*", "*://*.nationalgeographic.com/*", "*://*.nyteknik.se/*", + "*://*.nzherald.co.nz/*", "*://*.gitlab.com/magnolia1234" ], "run_at": "document_start", @@ -41,5 +42,5 @@ "webRequestBlocking", "" ], - "version": "2.6.2.5" + "version": "2.6.2.6" } diff --git a/manifest.json b/manifest.json index cde0f10..e4df029 100755 --- a/manifest.json +++ b/manifest.json @@ -30,6 +30,7 @@ "*://*.inkl.com/*", "*://*.nationalgeographic.com/*", "*://*.nyteknik.se/*", + "*://*.nzherald.co.nz/*", "*://*.gitlab.com/magnolia1234" ], "run_at": "document_start", @@ -657,5 +658,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.6.2.5" + "version": "2.6.2.6" } diff --git a/sites.js b/sites.js index 071d3eb..9c37a4f 100755 --- a/sites.js +++ b/sites.js @@ -1219,6 +1219,8 @@ var defaultSites = { }, "New Zealand Herald": { domain: "nzherald.co.nz", + allow_cookies: 1, + block_regex: /\.nzherald\.co\.nz\/pf\/resources\/(dist\/)?scripts\/(prebid|global-ad-script|tracking\/.+)\.js/, useragent: "bingbot" }, "Newsday": {