From 3d2d94830199cc37b6d930d960945a13e72fc222 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 22 Aug 2022 21:23:43 +0200 Subject: [PATCH] Fix Los Angeles Times & San Diego Union-Tribune --- background.js | 2 +- changelog.txt | 1 + contentScript.js | 7 ++++--- manifest.json | 2 +- sites.js | 4 ++-- sites_updated.json | 8 ++++++++ 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/background.js b/background.js index cd368dc2..f0130e2c 100644 --- a/background.js +++ b/background.js @@ -867,7 +867,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { var nl_mediahuis_noord_domain = (matchUrlDomain('ndcmediagroep.nl', details.url) && ['script'].includes(details.type) && !matchUrlDomain(nl_mediahuis_noord_domains, header_referer) && enabledSites.includes('###_nl_mediahuis_noord')); if (nl_mediahuis_noord_domain) nl_mediahuis_noord_domains = customAddRules(nl_mediahuis_noord_domains, {allow_cookies: 1}, blockedRegexes['lc.nl']); - } else if (header_referer_hostname.match(/\.(ca|com|org)$/)) { + } else if (header_referer_hostname.match(/\.(ca|com|net|org)$/)) { // remove cookies for Groupe Capitales Médias sites var ca_gcm_domain = (matchUrlDomain('gcm.omerlocdn.com', details.url) && ['xmlhttprequest'].includes(details.type) && !matchUrlDomain(ca_gcm_domains, header_referer) && enabledSites.includes('###_ca_gcm')); if (ca_gcm_domain) diff --git a/changelog.txt b/changelog.txt index 411953c5..c12c65a3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix Los Angeles Times & San Diego Union-Tribune * v2.8.1.0 (2022-08-21) Add Nw.de diff --git a/contentScript.js b/contentScript.js index 5e2eb719..558a5ac9 100644 --- a/contentScript.js +++ b/contentScript.js @@ -40,7 +40,7 @@ var usa_outside_mag_domains = ["backpacker.com", "betamtb.com", "betternutrition 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 = ['allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'barrons.com', 'businessoffashion.com', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'corrieredellosport.it', 'cyclingtips.com', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'enotes.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'economictimes.com', 'freiepresse.de', 'ilfoglio.it', 'inc42.com', 'lanouvellerepublique.fr', 'lesechos.fr', 'livemint.com', 'mid-day.com', 'nw.de', 'nytimes.com', 'nzherald.co.nz', 'scmp.com', 'seekingalpha.com', 'substack.com', 'telegraph.co.uk', 'theatlantic.com', 'thehindu.com', 'thetimes.co.uk', 'uol.com.br', 'wsj.com'].concat(de_funke_medien_domains, de_westfalen_medien_domains, es_epiberica_domains, es_epiberica_custom_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, ca_gcm_domains, nl_dpg_media_domains, no_nhst_media_domains, usa_hearst_comm_domains); +var arr_localstorage_hold = ['allgaeuer-zeitung.de', 'augsburger-allgemeine.de', 'barrons.com', 'businessoffashion.com', 'challenges.fr', 'charliehebdo.fr', 'cmjornal.pt', 'corriere.it', 'corrieredellosport.it', 'cyclingtips.com', 'eldiario.es', 'elespanol.com', 'elle.fr', 'elpais.com', 'elperiodico.com', 'enotes.com', 'estadao.com.br', 'forbes.com', 'fortune.com', 'economictimes.com', 'freiepresse.de', 'ilfoglio.it', 'inc42.com', 'lanouvellerepublique.fr', 'latimes.com', 'lesechos.fr', 'livemint.com', 'mid-day.com', 'nw.de', 'nytimes.com', 'nzherald.co.nz', 'sandiegouniontribune.com', 'scmp.com', 'seekingalpha.com', 'substack.com', 'telegraph.co.uk', 'theatlantic.com', 'thehindu.com', 'thetimes.co.uk', 'uol.com.br', 'wsj.com'].concat(de_funke_medien_domains, de_westfalen_medien_domains, es_epiberica_domains, es_epiberica_custom_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, ca_gcm_domains, nl_dpg_media_domains, no_nhst_media_domains, usa_hearst_comm_domains); if (!matchDomain(arr_localstorage_hold)) { window.localStorage.clear(); } @@ -3001,11 +3001,12 @@ else if (matchDomain('jpost.com')) { else if (matchDomain(['latimes.com', 'sandiegouniontribune.com'])) { if (window.location.search.startsWith('?_amp=true')) { - amp_unhide_subscr_section('amp-ad, [class*="-ad-wrapper"]'); + amp_unhide_subscr_section('amp-ad, [class*="-ad-wrapper"], div.enhancement'); } else { window.setTimeout(function () { let metering_bottompanel = document.querySelector('metering-bottompanel'); - removeDOMElement(metering_bottompanel); + let banners = document.querySelectorAll('div.enhancement, div.google-dfp-ad-wrapper'); + removeDOMElement(metering_bottompanel, ...banners); }, 500); } } diff --git a/manifest.json b/manifest.json index 147c8a9f..63ad7d14 100644 --- a/manifest.json +++ b/manifest.json @@ -697,5 +697,5 @@ "*://gcm.omerlocdn.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "2.8.1.0" + "version": "2.8.1.1" } diff --git a/sites.js b/sites.js index ad9c8b51..a07c5e3d 100644 --- a/sites.js +++ b/sites.js @@ -1079,7 +1079,7 @@ var defaultSites = { }, "Los Angeles Times": { domain: "latimes.com", - block_regex: /(metering\.platform\.latimes\.com\/v\d\/meter|cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js)/ + block_regex: /(metering\.platform\.latimes\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js)/ }, "Madsack Mediengruppe": { domain: "###_de_madsack", @@ -1466,7 +1466,7 @@ var defaultSites = { }, "San Diego Union Tribune": { domain: "sandiegouniontribune.com", - block_regex: /(metering\.platform\.sandiegouniontribune\.com\/v\d\/meter|cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js)/ + block_regex: /(metering\.platform\.sandiegouniontribune\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|subscriptions)-.+\.js)/ }, "Schleswig-Holsteinischer Zeitungsverlag": { domain: "shz.de", diff --git a/sites_updated.json b/sites_updated.json index b5894765..19529ba9 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -38,6 +38,10 @@ } ] }, + "Los Angeles Times": { + "domain": "latimes.com", + "block_regex": "(metering\\.platform\\.latimes\\.com\\/|cdn\\.ampproject\\.org\\/v\\d\\/amp-(access|subscriptions)-.+\\.js)" + }, "Neue Westfälische": { "domain": "nw.de", "allow_cookies": 1, @@ -50,5 +54,9 @@ } ], "new_site": 1 + }, + "San Diego Union Tribune": { + "domain": "sandiegouniontribune.com", + "block_regex": "(metering\\.platform\\.sandiegouniontribune\\.com\\/|cdn\\.ampproject\\.org\\/v\\d\\/amp-(access|subscriptions)-.+\\.js)" } }