From 27d84c3e397e22ecae4f8e026a4b43b2f81c1b82 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Wed, 22 Feb 2023 17:26:02 +0100 Subject: [PATCH] Fix Madsack Mediengruppe (custom flex sites) --- background.js | 5 ++++- changelog.txt | 1 + contentScript.js | 3 +-- contentScript_once_var.js | 8 +++++--- custom/manifest.json | 2 +- manifest.json | 2 +- sites.js | 1 - 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/background.js b/background.js index 822f6295..441dfa76 100644 --- a/background.js +++ b/background.js @@ -802,7 +802,7 @@ if (typeof browser !== 'object') { } } - var set_var_sites = ['cz.de', 'nzherald.co.nz', 'theglobeandmail.com'].concat(de_madsack_domains, de_madsack_custom_domains); + var set_var_sites = ['cz.de', 'nzherald.co.nz', 'theglobeandmail.com'].concat(de_madsack_domains); function runOnTab_once_var(tab) { let tabId = tab.id; let url = tab.url; @@ -1331,6 +1331,9 @@ ext_api.runtime.onMessage.addListener(function (message, sender) { rules = Object.values(defaultSites).filter(x => x.domain === group)[0]; if (group === '###_usa_gannett') rules.amp_unhide = 1; + else if (group === '###_de_madsack') + if (!set_var_sites.includes(custom_domain)) + set_var_sites.push(custom_domain); } if (rules) { customAddRules(custom_domain, rules); diff --git a/changelog.txt b/changelog.txt index 83fa01a0..880c7e96 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,7 @@ Add LosAndes.com.ar (Grupo Clarin) Remove Hln.be (fix obsolete) Remove Lequipe.fr (fix obsolete) Fix Harper's Magazine (modal) +Fix Madsack Mediengruppe (custom flex sites) Fix NK News (pro) Fix Quartz (newsletter) diff --git a/contentScript.js b/contentScript.js index b47fd08d..aa234051 100644 --- a/contentScript.js +++ b/contentScript.js @@ -10,7 +10,6 @@ var ca_gcm_domains = ['lesoleil.com'].concat(['latribune.ca', 'lavoixdelest.ca', var ca_torstar_domains = ['niagarafallsreview.ca', 'stcatharinesstandard.ca', 'thepeterboroughexaminer.com', 'therecord.com', 'thespec.com', 'thestar.com', 'wellandtribune.ca']; var de_funke_medien_domains = ['abendblatt.de', 'braunschweiger-zeitung.de', 'morgenpost.de', 'nrz.de', 'otz.de', 'thueringer-allgemeine.de', 'tlz.de', 'waz.de', 'wp.de', 'wr.de']; var de_madsack_domains = ['haz.de', 'kn-online.de', 'ln-online.de', 'lvz.de', 'maz-online.de', 'neuepresse.de', 'ostsee-zeitung.de', 'rnd.de']; -var de_madsack_custom_domains = ['dnn.de', 'gnz.de', 'goettinger-tageblatt.de', 'op-marburg.de', 'paz-online.de', 'siegener-zeitung.de', 'sn-online.de', 'waz-online.de']; var de_vrm_domains = ['allgemeine-zeitung.de', 'echo-online.de', 'wiesbadener-kurier.de']; var de_westfalen_medien_domains = ['muensterschezeitung.de', 'westfalen-blatt.de', 'wn.de']; var es_epiberica_domains = ['diariodemallorca.es', 'eldia.es', 'epe.es', 'farodevigo.es', 'informacion.es', 'laprovincia.es', 'levante-emv.com', 'lne.es', 'mallorcazeitung.es']; @@ -975,7 +974,7 @@ else if (matchDomain(de_funke_medien_domains) || document.querySelector('a[href= sessionStorage.setItem('deobfuscate', 'true'); } -else if (matchDomain(de_madsack_domains) || matchDomain(de_madsack_custom_domains)) { +else if (matchDomain(de_madsack_domains) || document.querySelector('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"]'); diff --git a/contentScript_once_var.js b/contentScript_once_var.js index 4b1775f6..563d43f1 100644 --- a/contentScript_once_var.js +++ b/contentScript_once_var.js @@ -1,8 +1,10 @@ //'use strict'; var ext_api = (typeof browser === 'object') ? browser : chrome; +var hostname = window.location.hostname; var de_madsack_domains = ['haz.de', 'kn-online.de', 'ln-online.de', 'lvz.de', 'maz-online.de', 'neuepresse.de', 'ostsee-zeitung.de', 'rnd.de']; -var de_madsack_custom_domains = ['dnn.de', 'gnz.de', 'goettinger-tageblatt.de', 'op-marburg.de', 'paz-online.de', 'siegener-zeitung.de', 'sn-online.de', 'waz-online.de']; + +if (hostname.match(/\.de$/)) { if (matchDomain('cz.de')) { function cz_unhide(node) { @@ -14,7 +16,7 @@ if (matchDomain('cz.de')) { waitDOMElement('div#erasmo', 'DIV', cz_unhide); } -else if (matchDomain(de_madsack_domains) || matchDomain(de_madsack_custom_domains)) { +else if (matchDomain(de_madsack_domains) || document.querySelector('link[href*=".rndtech.de/"]')) { function madsack_main() { let done = false; for (let n = 0; n < 10; n++) { @@ -29,7 +31,7 @@ else if (matchDomain(de_madsack_domains) || matchDomain(de_madsack_custom_domain insert_script(madsack_main); } -else if (matchDomain('nzherald.co.nz')) { +} else if (matchDomain('nzherald.co.nz')) { function nzherald_main() { let done = false; for (let n = 0; n < 10; n++) { diff --git a/custom/manifest.json b/custom/manifest.json index ecc591a8..9ead9464 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.0.6.3" + "version": "3.0.6.4" } diff --git a/manifest.json b/manifest.json index d68ea59f..a5365839 100644 --- a/manifest.json +++ b/manifest.json @@ -739,5 +739,5 @@ "*://*.wallkit.net/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.0.6.3" + "version": "3.0.6.4" } diff --git a/sites.js b/sites.js index 5fd3b2de..f079c094 100644 --- a/sites.js +++ b/sites.js @@ -2439,7 +2439,6 @@ expandSiteRules(defaultSites); // grouped domains (background) var au_news_corp_domains = grouped_sites['###_au_news_corp']; var de_madsack_domains = grouped_sites['###_de_madsack']; -var de_madsack_custom_domains = ['dnn.de', 'gnz.de', 'goettinger-tageblatt.de', 'op-marburg.de', 'paz-online.de', 'siegener-zeitung.de', 'sn-online.de', 'waz-online.de']; var es_grupo_vocento_domains = grouped_sites['###_es_grupo_vocento']; var nl_mediahuis_region_domains = grouped_sites['###_nl_mediahuis_region']; var no_nhst_media_domains = grouped_sites['###_no_nhst_media'];