From cd15094eb4d459e2bcf09394a0c91ba25a31e3a2 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 6 Apr 2024 07:24:22 +0200 Subject: [PATCH] Add Nordwest Zeitung Fix Capital.fr (videos) --- README.md | 1 + changelog.txt | 1 + contentScript.js | 34 ++++++++++++++++++++++++++++------ custom/manifest.json | 2 +- custom/sites_custom.json | 2 +- manifest.json | 3 ++- sites.js | 7 ++++++- sites_updated.json | 6 ++++++ 8 files changed, 46 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 19edcbe..c792850 100644 --- a/README.md +++ b/README.md @@ -614,6 +614,7 @@ Grouped in options:\ [Kurier.at](https://kurier.at) - [Mitteldeutsche Zeitung](https://www.mz.de) - [Neue Westfälische](https://www.nw.de) - +[Nordwest Zeitung](https://www.nwzonline.de) - [Philosophie Magazin](https://www.philomag.de) - [Piqd](https://www.piqd.de) - [Profil.at](https://www.profil.at) - diff --git a/changelog.txt b/changelog.txt index ce62de2..76f02a1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,7 @@ Add Bild.de (fetch from archive.is) Add Capital.fr Add Crain's Grand Rapids Business Add Hln.be (fetch from archive.is) +Add Nordwest Zeitung Add Spektrum.de Fix LeMonde.fr (view more) Fix MediaNews Group (ld_json_url) diff --git a/contentScript.js b/contentScript.js index 16d8d8f..e855443 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1209,8 +1209,8 @@ else if (matchDomain(['noz.de', 'shz.de', 'svz.de'])) { if (window.location.pathname.endsWith('/amp')) { amp_unhide_access_hide('="NOT data.reduced"', '="data.reduced"', 'amp-ad, amp-embed, .ads-wrapper, #flying-carpet-wrapper'); } else { - let ads = document.querySelectorAll('div.nozmhn_ad'); - hideDOMElement(...ads); + let ads = 'div.nozmhn_ad'; + hideDOMStyle(ads); } } @@ -1222,12 +1222,17 @@ else if (matchDomain('nw.de')) { } } +else if (matchDomain('nwzonline.de')) { + let ads = 'div.adslot'; + hideDOMStyle(ads); +} + else if (matchDomain(['nzz.ch', 'themarket.ch'])) { let fade = document.querySelectorAll('.nzzinteraction'); for (let elem of fade) elem.classList.remove('nzzinteraction'); - let ads = document.querySelectorAll('div.resor'); - hideDOMElement(...ads); + let ads = 'div.resor'; + hideDOMStyle(ads); } else if (matchDomain('philomag.de')) { @@ -1849,6 +1854,20 @@ else if (matchDomain('autoplus.fr')) { } else if (matchDomain('capital.fr')) { + let videos = document.querySelectorAll('div > div#prisma-player-leader[data-ads-core*="Dailymotion"]'); + for (let video of videos) { + try { + let json = JSON.parse(video.getAttribute('data-ads-core')); + if (json && json.playerVideoId) { + let iframe = document.createElement('iframe'); + iframe.src = 'https://www.dailymotion.com/embed/video/' + json.playerVideoId; + iframe.style = 'height: ' + video.offsetHeight + 'px; width: ' + video.offsetWidth + 'px;'; + video.parentNode.replaceChild(iframe, video); + } + } catch (err) { + console.log(err); + } + } let ads = 'div.containerAds, div.ads-introText, div.outbrain-ads'; hideDOMStyle(ads); } @@ -4640,8 +4659,11 @@ else if (matchDomain('jpost.com')) { } else if (matchDomain(['latimes.com', 'sandiegouniontribune.com'])) { - let ads = document.querySelectorAll('div.google-dfp-ad-wrapper, div.revcontent'); - hideDOMElement(...ads); + let subscribers = pageContains('div.infobox > p.infobox-title', /subscribers/i); + if (subscribers.length) + removeDOMElement(subscribers[0].parentNode); + let ads = 'div.google-dfp-ad-wrapper, div.revcontent'; + hideDOMStyle(ads); } else if (matchDomain('ledevoir.com')) { diff --git a/custom/manifest.json b/custom/manifest.json index 66c93d6..aa9daa9 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.6.2.7" + "version": "3.6.2.8" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index df1cb6e..40d46ee 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -795,7 +795,7 @@ "ld_json": "div.c-pro-wall__wrapper|div.pro-blur>p" }, "Tamedia.ch": { - "add_ext_link": "div#piano-premium|p[class^='ArticleParagraph_root_']", + "add_ext_link": "div#piano-premium>div|article p", "add_ext_link_type": "google_search_tool", "allow_cookies": 1, "block_regex": "\\.tinypass\\.com", diff --git a/manifest.json b/manifest.json index 8a75726..b338a50 100644 --- a/manifest.json +++ b/manifest.json @@ -535,6 +535,7 @@ "*://*.ntnews.com.au/*", "*://*.nw.de/*", "*://*.nwitimes.com/*", + "*://*.nwzonline.de/*", "*://*.nybooks.com/*", "*://*.nydailynews.com/*", "*://*.nymag.com/*", @@ -871,5 +872,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.6.2.7" + "version": "3.6.2.8" } diff --git a/sites.js b/sites.js index 11758c2..0d2249d 100644 --- a/sites.js +++ b/sites.js @@ -1855,6 +1855,11 @@ var defaultSites = { domain: "asia.nikkei.com", remove_cookies_select_drop: ["xbc"] }, + "Nordwest Zeitung": { + domain: "nwzonline.de", + allow_cookies: 1, + block_regex: /\.piano\.io\// + }, "NOZ/MHN Mediengruppe": { domain: "###_de_noz_mhn", group: [ @@ -3160,4 +3165,4 @@ var fr_indigo_nofix_domains = ['africaintelligence.com', 'africaintelligence.fr' var fr_jamg_nofix_domains = ['africabusinessplus.com', 'jeuneafrique.com', 'theafricareport.com']; var it_gedi_nofix_domains = ['gelocal.it', 'limesonline.com']; var nl_mediahuis_region_nofix_domains = ['gooieneemlander.nl', 'haarlemsdagblad.nl', 'ijmuidercourant.nl', 'leidschdagblad.nl', 'noordhollandsdagblad.nl']; -var nofix_sites = ['11freunde.de', 'aamulehti.fi', 'aftenposten.no', 'aftonbladet.se', 'allgaeuer-zeitung.de', 'americanscientist.org', 'arkansasonline.com', 'asahi.com', 'asiatimes.com', 'aviationweek.com', 'badische-zeitung.de', 'bhaskar.com', 'bloomberglaw.com', 'bloombergtax.com', 'bnef.com', 'bnn.de', 'borsen.dk', 'businessdesk.co.nz', 'businessinsider.de', 'businessinsider.jp', 'businesslive.co.za', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'catalyst-journal.com', 'chegg.com', 'compactmag.com', 'coursehero.com', 'denikn.cz', 'deutsche-wirtschafts-nachrichten.de', 'die-glocke.de', 'dn.no', 'dn.se', 'elordenmundial.com', 'entrepreneur.com', 'epw.in', 'ewmagazine.nl', 'falter.at', 'finance.si', 'franc-tireur.fr', 'ftchinese.com', 'ftchineselive.com', 'gamestar.de', 'geo.de', 'golem.de', 'gp.se', 'handelsblatt.com', 'hbrarabic.com', 'hbrchina.org', 'hbrfrance.fr', 'heise.de', 'hs.fi', 'information.dk', 'investors.com', 'iltalehti.fi', 'jacobin.com', 'jungefreiheit.de', 'kleinezeitung.at', 'krone.at', 'laverita.info', 'lavie.fr', 'lavozdegalicia.es', 'law360.co.uk', 'law360.com', 'le1hebdo.fr', 'leconomiste.com', 'lefigaro.fr', 'lefilmfrancais.com', 'lequipe.fr', 'lesjours.fr', 'letemps.ch', 'liberation.fr', 'libertiesjournal.com', 'lr-online.de', 'main-echo.de', 'mainpost.de', 'manager-magazin.de', 'maville.com', 'medianama.com', 'mediapart.fr', 'milanofinanza.it', 'mittelbayerische.de', 'monde-diplomatique.fr', 'mondediplo.com', 'money.it', 'moneycontrol.com', 'moodys.com', 'morningstar.com', 'motorsport.com', 'moz.de', 'nachrichten.at', 'nationaljournal.com', 'nature.com', 'nbr.co.nz', 'newcriterion.com', 'news24.com', 'nn.de', 'nwzonline.de', 'on3.com', 'ouest-france.fr', 'philonomist.com', 'pnp.de', 'politicopro.com', 'politiken.dk', 'pressreader.com', 'publico.pt', 'puck.news', 'quillette.com', 'rbc.ru', 'republic.ru', 'rheinpfalz.de', 'risk.net', 'rnz.de', 'saechsische.de', 'sciencedirect.com', 'springer.com', 'statnews.com', 'stern.de', 'stimme.de', 'streetinsider.com', 'substack.com', 'svd.se', 'swp.de', 'taxation.co.uk', 'taxjournal.com', 'the-ken.com', 'thebanker.com', 'theinformation.com', 'theinitium.com', 'themorningcontext.com', 'theparisreview.org', 'thestar.com.my', 'thewirechina.com', 'timeslive.co.za', 'usine-digitale.fr', 'vedomosti.ru', 'weltwoche.ch', 'weltwoche.de', 'wissenschaft.de', 'worldpoliticsreview.com', 'wz.de', 'zaobao.com.sg'].concat(be_mediahuis_nofix_domains, de_funke_medien_nofix_domains, de_rp_aachen_medien_nofix_domains, de_westfalen_medien_nofix_domains, fr_be_groupe_rossel_nofix_domains, fr_groupe_ebra_nofix_domains, fr_indigo_nofix_domains, fr_jamg_nofix_domains, it_gedi_nofix_domains, nl_mediahuis_region_nofix_domains); +var nofix_sites = ['11freunde.de', 'aamulehti.fi', 'aftenposten.no', 'aftonbladet.se', 'allgaeuer-zeitung.de', 'americanscientist.org', 'arkansasonline.com', 'asahi.com', 'asiatimes.com', 'aviationweek.com', 'badische-zeitung.de', 'bhaskar.com', 'bloomberglaw.com', 'bloombergtax.com', 'bnef.com', 'bnn.de', 'borsen.dk', 'businessdesk.co.nz', 'businessinsider.de', 'businessinsider.jp', 'businesslive.co.za', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'catalyst-journal.com', 'chegg.com', 'compactmag.com', 'coursehero.com', 'denikn.cz', 'deutsche-wirtschafts-nachrichten.de', 'die-glocke.de', 'dn.no', 'dn.se', 'elordenmundial.com', 'entrepreneur.com', 'epw.in', 'ewmagazine.nl', 'falter.at', 'finance.si', 'franc-tireur.fr', 'ftchinese.com', 'ftchineselive.com', 'gamestar.de', 'geo.de', 'golem.de', 'gp.se', 'handelsblatt.com', 'hbrarabic.com', 'hbrchina.org', 'hbrfrance.fr', 'heise.de', 'hs.fi', 'information.dk', 'investors.com', 'iltalehti.fi', 'jacobin.com', 'jungefreiheit.de', 'kleinezeitung.at', 'krone.at', 'laverita.info', 'lavie.fr', 'lavozdegalicia.es', 'law360.co.uk', 'law360.com', 'le1hebdo.fr', 'leconomiste.com', 'lefigaro.fr', 'lefilmfrancais.com', 'lequipe.fr', 'lesjours.fr', 'letemps.ch', 'liberation.fr', 'libertiesjournal.com', 'lr-online.de', 'main-echo.de', 'mainpost.de', 'manager-magazin.de', 'maville.com', 'medianama.com', 'mediapart.fr', 'milanofinanza.it', 'mittelbayerische.de', 'monde-diplomatique.fr', 'mondediplo.com', 'money.it', 'moneycontrol.com', 'moodys.com', 'morningstar.com', 'motorsport.com', 'moz.de', 'nachrichten.at', 'nationaljournal.com', 'nature.com', 'nbr.co.nz', 'newcriterion.com', 'news24.com', 'nn.de', 'on3.com', 'ouest-france.fr', 'philonomist.com', 'pnp.de', 'politicopro.com', 'politiken.dk', 'pressreader.com', 'publico.pt', 'puck.news', 'quillette.com', 'rbc.ru', 'republic.ru', 'rheinpfalz.de', 'risk.net', 'rnz.de', 'saechsische.de', 'sciencedirect.com', 'springer.com', 'statnews.com', 'stern.de', 'stimme.de', 'streetinsider.com', 'substack.com', 'svd.se', 'swp.de', 'taxation.co.uk', 'taxjournal.com', 'the-ken.com', 'thebanker.com', 'theinformation.com', 'theinitium.com', 'themorningcontext.com', 'theparisreview.org', 'thestar.com.my', 'thewirechina.com', 'timeslive.co.za', 'usine-digitale.fr', 'vedomosti.ru', 'weltwoche.ch', 'weltwoche.de', 'wissenschaft.de', 'worldpoliticsreview.com', 'wz.de', 'zaobao.com.sg'].concat(be_mediahuis_nofix_domains, de_funke_medien_nofix_domains, de_rp_aachen_medien_nofix_domains, de_westfalen_medien_nofix_domains, fr_be_groupe_rossel_nofix_domains, fr_groupe_ebra_nofix_domains, fr_indigo_nofix_domains, fr_jamg_nofix_domains, it_gedi_nofix_domains, nl_mediahuis_region_nofix_domains); diff --git a/sites_updated.json b/sites_updated.json index 916f69c..85d00d9 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -100,6 +100,12 @@ "ld_json": "div.FrsvM|div.story-element-text", "upd_version": "3.6.0.8" }, + "Nordwest Zeitung": { + "domain": "nwzonline.de", + "allow_cookies": 1, + "block_regex": "\\.piano\\.io", + "upd_version": "3.6.2.8" + }, "Reuters": { "domain": "reuters.com", "allow_cookies": 1,