From 7944eb62b1dfbed69c7aef1911147fe339af6332 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Fri, 8 Mar 2024 17:57:17 +0100 Subject: [PATCH] Fix Motor Presse Stuttgart (xhr) --- background.js | 2 +- changelog.txt | 1 + contentScript.js | 8 +++++- contentScript_once.js | 4 +++ custom/manifest.json | 2 +- manifest.json | 2 +- options/version.js | 61 +++++++++++++++++++++++-------------------- sites.js | 6 ++--- sites_updated.json | 13 +++++++++ 9 files changed, 64 insertions(+), 35 deletions(-) diff --git a/background.js b/background.js index a9c93bb..c48e22b 100644 --- a/background.js +++ b/background.js @@ -1498,7 +1498,7 @@ ext_api.runtime.onMessage.addListener(function (message, sender) { let custom_domain = message.data.domain; let group = message.data.group; if (group) { - let nofix_groups = ['###_fi_alma_talent', '###_fi_kaleva', '###_it_citynews', '###_nl_vmnmedia', '###_substack_custom', '###_uk_delinian']; + let nofix_groups = ['###_beehiiv', '###_fi_alma_talent', '###_fi_kaleva', '###_it_citynews', '###_nl_vmnmedia', '###_se_gota_media', '###_substack_custom', '###_uk_delinian']; if (!custom_flex_domains.includes(custom_domain)) { if (!nofix_groups.includes(group)) { if (custom_flex[group]) diff --git a/changelog.txt b/changelog.txt index e6ab3a2..d03bbec 100644 --- a/changelog.txt +++ b/changelog.txt @@ -10,6 +10,7 @@ Fix Boersen-zeitung.de (timing) Fix ElMundo.es (colegios - no amp-fix) Fix Hearst newspapers (anti-adblocker) Fix Il Sole 24 Ore (24+ only) +Fix Motor Presse Stuttgart (xhr) Fix The Quint (css) * v3.5.8.0 (2024-03-03) diff --git a/contentScript.js b/contentScript.js index 4451e24..589590b 100644 --- a/contentScript.js +++ b/contentScript.js @@ -19,6 +19,7 @@ var de_funke_medien_domains = ['abendblatt.de', 'braunschweiger-zeitung.de', 'mo var de_lv_domains = ['profi.de', 'wochenblatt.com']; 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_mhs_custom_domains = ['cannstatter-zeitung.de', 'esslinger-zeitung.de', 'frankenpost.de', 'insuedthueringen.de', 'krzbb.de', 'kurier.de', 'np-coburg.de']; +var de_motor_presse_domains = ['aerokurier.de', 'auto-motor-und-sport.de', 'flugrevue.de', 'motorradonline.de', 'womenshealth.de']; var de_vrm_domains = ['allgemeine-zeitung.de', 'echo-online.de', 'wiesbadener-kurier.de']; var de_vrm_custom_domains = ['buerstaedter-zeitung.de', 'hochheimer-zeitung.de', 'lampertheimer-zeitung.de', 'lauterbacher-anzeiger.de', 'main-spitze.de', 'mittelhessen.de', 'oberhessische-zeitung.de', 'wormser-zeitung.de']; var es_epiberica_domains = ['diariodemallorca.es', 'eldia.es', 'elperiodico.com', 'epe.es', 'farodevigo.es', 'informacion.es', 'laprovincia.es', 'levante-emv.com', 'lne.es', 'mallorcazeitung.es', 'superdeporte.es']; @@ -1417,7 +1418,7 @@ else if (matchDomain('vol.at')) { else if (matchDomain('welt.de')) { let url = window.location.href; getArchive(url, 'div.contains_walled_content', '', 'article'); - let ads = document.querySelectorAll('div[data-component="Outbrain"], div[data-component="OEmbedComponent"], div[class*="c-ad"]'); + let ads = document.querySelectorAll('div[data-component="Outbrain"], div[class*="c-ad"]'); hideDOMElement(...ads); } @@ -1470,6 +1471,11 @@ else if (matchDomain(de_madsack_domains) || document.querySelector('head > link[ } } +else if (matchDomain(de_motor_presse_domains)) { + let ads = document.querySelectorAll('div#ads-container, div.va-sponsored, div.mps_markAd'); + hideDOMElement(...ads); +} + else if (matchDomain('ruhrnachrichten.de') || document.querySelector('a.mgw-logo[href^="https://mgw.de"]')) { let pathname = window.location.pathname; let article_id; diff --git a/contentScript_once.js b/contentScript_once.js index 04d8116..332db2b 100644 --- a/contentScript_once.js +++ b/contentScript_once.js @@ -35,6 +35,8 @@ window.setTimeout(function () { if (hostname) { if (document.querySelector('script[src*=".medium.com/"]') || matchDomain(['plainenglish.io'])) group = 'medium.com'; + else if (document.querySelector('head > meta[property="og:image"][content*="beehiiv"]')) + group = '###_beehiiv';// no fix else if (document.querySelector('head > link[href*="/leaky-paywall"], script[src*="/leaky-paywall"], div[id^="issuem-leaky-paywall-"]')) group = '###_wp_leaky_paywall'; else if (document.querySelector('script[src*="/substackcdn.com/"], link[rel="stylesheet"][href*="/substackcdn.com/"]')) @@ -102,6 +104,8 @@ window.setTimeout(function () { } else if (hostname.endsWith('.se')) { if (document.querySelector('footer > div > div > a[href="https://www.nwtmedia.se/"]')) group = '###_se_nwt_media'; + else if (document.querySelector('head > link[href^="https://cdn.gotamedia.se/"]')) + group = '###_se_gota_media';// no fix } else if (hostname.match(/\.(co\.uk|scot)$/)) { if (document.querySelector('footer > div a[href^="https://www.nationalworldplc.com"]')) group = '###_uk_nat_world'; diff --git a/custom/manifest.json b/custom/manifest.json index 2ec747c..73ab28e 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.5.8.5" + "version": "3.5.8.6" } diff --git a/manifest.json b/manifest.json index 6652a17..83de107 100644 --- a/manifest.json +++ b/manifest.json @@ -853,5 +853,5 @@ "*://archive.vn/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.5.8.5" + "version": "3.5.8.6" } diff --git a/options/version.js b/options/version.js index c608112..8de4cb0 100644 --- a/options/version.js +++ b/options/version.js @@ -2,15 +2,36 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; var manifestData = ext_api.runtime.getManifest(); var url_loc = manifestData.key ? 'chrome' : 'firefox'; +var ext_url = 'https://gitlab.com/magnolia1234/bypass-paywalls-' + url_loc + '-clean'; +var ext_name = manifestData.name; +var self_hosted = !!(manifestData.browser_specific_settings && manifestData.browser_specific_settings.gecko.update_url); var version_str = 'v' + manifestData.version; var version_span = document.querySelector('span#version'); if (version_span) version_span.innerText = version_str; var version_span_new = document.querySelector('span#version_new'); -if (version_span_new) - version_span_new.setAttribute('style', 'font-weight: bold;'); +version_span_new.setAttribute('style', 'font-weight: bold;'); var anchorEl; +function show_warning() { + let warning; + if (!ext_name.includes('Clean')) { + warning = 'fake'; + } else if (!self_hosted) { + warning = 'cloned'; + } + if (warning) { + let par = document.createElement('p'); + let ext_link = document.createElement('a'); + ext_link.href = ext_url; + ext_link.innerText = "You've installed a " + warning + " version of Bypass Paywalls Clean"; + ext_link.target = '_blank'; + par.style = 'font-weight: bold;'; + par.appendChild(ext_link); + version_span_new.appendChild(par); + } +} + function show_update(ext_version_new, ext_upd_version_new = '', check = true) { if (ext_version_new) { ext_api.management.getSelf(function (result) { @@ -24,34 +45,17 @@ function show_update(ext_version_new, ext_upd_version_new = '', check = true) { }); anchorEl = document.createElement('a'); anchorEl.target = '_blank'; - let manifest_id = manifestData.browser_specific_settings ? manifestData.browser_specific_settings.gecko.id : ''; - if (manifest_id && manifest_id.includes('magnolia')) { - if (installType === 'development') - anchorEl.href = 'https://gitlab.com/magnolia1234/bypass-paywalls-' + url_loc + '-clean'; - else { - anchorEl.href = 'https://gitlab.com/magnolia1234/bypass-paywalls-' + url_loc + '-clean/-/releases'; - ext_version_new = ext_version_new.replace(/\d$/, '0'); - } - } - if (installType !== 'development') + if (installType === 'development') + anchorEl.href = ext_url; + else { + anchorEl.href = ext_url + '/-/releases'; ext_version_new = ext_version_new.replace(/\d$/, '0'); + } anchorEl.innerText = 'New release v' + ext_version_new; - anchorEl.target = '_blank'; version_span_new.appendChild(anchorEl); - let warning; - if (!manifestData.name.includes('Clean')) { - warning = 'fake'; - } else if (manifest_id && !manifest_id.match(/^magnolia(_limited_permissions)?@12\.34$/)) { - warning = 'cloned'; - } - if (warning) { - let par = document.createElement('p'); - par.innerText = "You've installed a " + warning + " version of BPC (check help/GitLab)"; - par.style = 'font-weight: bold;'; - version_span_new.appendChild(par); - } } }); + show_warning(); } else if (check) { anchorEl = document.createElement('a'); anchorEl.text = 'Check Twitter for latest update'; @@ -63,13 +67,13 @@ function show_update(ext_version_new, ext_upd_version_new = '', check = true) { function check_version_update(ext_version_new, popup) { if (!popup) { - let manifest_new = 'https://gitlab.com/magnolia1234/bypass-paywalls-' + url_loc + '-clean/raw/master/manifest.json'; + let manifest_new = ext_url + '/raw/master/manifest.json'; fetch(manifest_new) .then(response => { if (response.ok) { response.json().then(json => { var version_new = json['version']; - if (manifestData.browser_specific_settings && manifestData.browser_specific_settings.gecko.update_url) { + if (self_hosted) { let json_upd_version_new = manifestData.browser_specific_settings.gecko.update_url; fetch(json_upd_version_new) .then(response => { @@ -100,5 +104,6 @@ ext_api.storage.local.get({optInUpdate: true, ext_version_new: false}, function if (result.optInUpdate) { let popup = document.querySelector('script[id="popup"]'); check_version_update(result.ext_version_new, popup); - } + } else + show_warning(); }); diff --git a/sites.js b/sites.js index 03c8a3f..c8d80a8 100644 --- a/sites.js +++ b/sites.js @@ -306,7 +306,7 @@ var defaultSites = { "Business Insider": { domain: "businessinsider.com", allow_cookies: 1, - block_regex: /\.tinypass\.com\// + block_regex: /(\.tinypass\.com\/|\.sophi\.io\/)/ }, "Business Insider Nederland": { domain: "businessinsider.nl", @@ -1713,7 +1713,7 @@ var defaultSites = { "womenshealth.de" ], allow_cookies: 1, - block_regex: /\.de\/thenewsbar\/static\/pw\.js/ + block_regex: "\\.{domain}\\/thenewsbar\\/config\\/" }, "Mountain View Voice": { domain: "mv-voice.com" @@ -3069,4 +3069,4 @@ var fr_groupe_ebra_nofix_domains = ['bienpublic.com', 'dna.fr', 'estrepublicain. var fr_indigo_nofix_domains = ['africaintelligence.com', 'africaintelligence.fr', 'glitz.paris', 'intelligenceonline.com', 'intelligenceonline.fr', 'lalettre.fr']; 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', 'arkansasonline.com', 'asahi.com', 'asiatimes.com', 'aviationweek.com', 'badische-zeitung.de', 'bhaskar.com', 'bloomberglaw.com', 'bloombergtax.com', 'bnef.com', 'bnn.de', 'borsen.dk', 'businessinsider.de', 'businessinsider.jp', 'businesslive.co.za', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'catalyst-journal.com', 'chegg.com', 'codesports.com.au', 'compactmag.com', 'courrierinternational.com', 'coursehero.com', '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', 'gva.be', 'handelsblatt.com', 'hbrarabic.com', 'hbrchina.org', 'hbrfrance.fr', 'heise.de', 'hs.fi', 'information.dk', 'investors.com', 'iltalehti.fi', 'jacobin.com', 'jeuneafrique.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', 'lemonde.fr', 'lequipe.fr', 'lesjours.fr', 'letemps.ch', 'liberation.fr', 'libertiesjournal.com', 'lr-online.de', 'main-echo.de', 'mainpost.de', 'manager-magazin.de', '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', 'newslaundry.com', 'nn.de', 'nwzonline.de', 'observador.pt', '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', 'suedkurier.de', 'swp.de', 'taxation.co.uk', 'taxjournal.com', 'the-ken.com', 'theinformation.com', 'theinitium.com', 'themorningcontext.com', 'theparisreview.org', 'thestar.com.my', 'thewirechina.com', 'timeslive.co.za', 'weltwoche.ch', 'weltwoche.de', 'wissenschaft.de', 'worldpoliticsreview.com', 'wz.de', 'zaobao.com.sg'].concat(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, it_gedi_nofix_domains, nl_mediahuis_region_nofix_domains); +var nofix_sites = ['11freunde.de', 'aamulehti.fi', 'aftenposten.no', 'aftonbladet.se', 'allgaeuer-zeitung.de', 'arkansasonline.com', 'asahi.com', 'asiatimes.com', 'aviationweek.com', 'badische-zeitung.de', 'bhaskar.com', 'bloomberglaw.com', 'bloombergtax.com', 'bnef.com', 'bnn.de', 'borsen.dk', 'businessinsider.de', 'businessinsider.jp', 'businesslive.co.za', 'businesstimes.com.sg', 'caixin.com', 'caixinglobal.com', 'caravanmagazine.in', 'catalyst-journal.com', 'chegg.com', 'codesports.com.au', 'compactmag.com', 'courrierinternational.com', 'coursehero.com', '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', 'gva.be', 'handelsblatt.com', 'hbrarabic.com', 'hbrchina.org', 'hbrfrance.fr', 'heise.de', 'hs.fi', 'information.dk', 'investors.com', 'iltalehti.fi', 'jacobin.com', 'jeuneafrique.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', 'lemonde.fr', 'lequipe.fr', 'lesjours.fr', 'letemps.ch', 'liberation.fr', 'libertiesjournal.com', 'lr-online.de', 'main-echo.de', 'mainpost.de', 'manager-magazin.de', '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', 'newslaundry.com', 'nn.de', 'nwzonline.de', 'observador.pt', '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', 'suedkurier.de', 'svd.se', 'swp.de', 'taxation.co.uk', 'taxjournal.com', 'the-ken.com', 'theinformation.com', 'theinitium.com', 'themorningcontext.com', 'theparisreview.org', 'thestar.com.my', 'thewirechina.com', 'timeslive.co.za', 'weltwoche.ch', 'weltwoche.de', 'wissenschaft.de', 'worldpoliticsreview.com', 'wz.de', 'zaobao.com.sg'].concat(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, it_gedi_nofix_domains, nl_mediahuis_region_nofix_domains); diff --git a/sites_updated.json b/sites_updated.json index ad4b66e..8bdc765 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -129,6 +129,19 @@ "block_regex": "(\\.medscapestatic\\.com\\/.+\\/medscape-library|\\.wbmdstatic\\.com\\/.+\\/chunk-vendors\\..+)\\.js", "upd_version": "3.5.7.6" }, + "Motor Presse Stuttgart": { + "domain": "###_de_motor_presse", + "group": [ + "aerokurier.de", + "auto-motor-und-sport.de", + "flugrevue.de", + "motorradonline.de", + "womenshealth.de" + ], + "allow_cookies": 1, + "block_regex": "\\.{domain}\\/thenewsbar\\/config", + "upd_version": "3.5.8.6" + }, "Polityka.pl": { "domain": "polityka.pl", "allow_cookies": 1,