diff --git a/README.md b/README.md index 17593b3..a9ea321 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ _* free articles only._ [SofRep](https://sofrep.com) - [Sports Illustrated](https://www.si.com) - [The Art Newspaper](https://www.theartnewspaper.com) - +[The Athletic](https://theathletic.com) - [The Daily Beast](https://www.thedailybeast.com)* - [The Point Magazine](https://thepointmag.com) - [Vanity Fair](https://www.vanityfair.com) - @@ -205,6 +206,7 @@ Tribune Publishing Company sites like [London Review of Books](https://www.lrb.co.uk) - [New Left Review](https://newleftreview.org) - [Prospect Magazine](https://www.prospectmagazine.co.uk) - +[The Athletic UK](https://theathletic.com) - [The Economist](https://www.economist.com) - [The Irish Times](https://www.irishtimes.com) - [The New Statesman](https://www.newstatesman.com) - diff --git a/background.js b/background.js index fb18ba8..c3a1f68 100644 --- a/background.js +++ b/background.js @@ -305,6 +305,7 @@ var blockedRegexes = { 'haaretz.co.il': /haaretz\.co\.il\/htz\/js\/inter\.js/, 'haaretz.com': /haaretz\.com\/hdc\/web\/js\/minified\/header-scripts-int.js/, 'hbr.org': /\.tinypass\.com\//, + 'hilltimes.com': /\.hilltimes\.com\/.+\/js\/loadingoverlay\/loadingoverlay\.min\.js/, 'historyextra.com': /\.evolok\.net\/.+\/authorize\//, 'houstonchronicle.com': /\.blueconic\.net\//, 'ilgiorno.it': /\.tinypass\.com\//, @@ -376,7 +377,6 @@ var blockedRegexes = { 'telegraph.co.uk': /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-(access|ad|consent)-.+\.js|\.telegraph\.co\.uk\/.+\/piano.+\.js|assets\.adobedtm\.com\/.+\.js)/, 'theartnewspaper.com': /\.amazonaws.com\/production-website-scripts\/bouncer\.js/, 'thedailybeast.com': /\.tinypass\.com\//, - 'hilltimes.com': /\.hilltimes\.com\/.+\/js\/loadingoverlay\/loadingoverlay\.min\.js/, 'thehindu.com': /(cdn\.cxense\.com\/|\.tinypass\.com\/)/, 'thehindubusinessline.com': /(cdn\.cxense\.com\/|\.tinypass\.com\/)/, 'thenation.com': /\.tinypass\.com\//, @@ -436,7 +436,8 @@ var grouped_sites = { '###_nl_ad_region': nl_ad_region_domains, '###_usa_mcc': usa_mcc_domains, '###_usa_nymag': usa_nymag_domains, -'###_usa_tribune': usa_tribune_domains +'###_usa_tribune': usa_tribune_domains, +'###_usa_theathletic': usa_theathletic_domains }; function add_grouped__enabled_domains(groups) { @@ -515,6 +516,10 @@ function add_grouped_sites(init_rules) { allow_cookies.push(domain); blockedRegexes[domain] = /\.tribdss\.com\//; } + for (let domain of usa_theathletic_domains) { + allow_cookies.push(domain); + blockedRegexes[domain] = /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/; + } // rules only for (let domain of au_nine_domains) @@ -1007,7 +1012,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { let usa_mw_site = (matchUrlDomain('wsj.net', details.url) && matchUrlDomain('marketwatch.com', header_referer)); allow_ext_source = allow_ext_source || inkl_site || cl_elmerc_site || es_elesp_site || it_repubblica_site || uk_nlr_site || usa_discmag_site || usa_mw_site; - bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'lne.es', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'seekingalpha.com', 'shz.de', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains), header_referer)); + bpc_amp_site = (matchUrlDomain('cdn.ampproject.org', details.url) && matchUrlDomain(['augsburger-allgemeine.de', 'barrons.com', 'belfasttelegraph.co.uk', 'cicero.de', 'cmjornal.pt', 'elmundo.es', 'elpais.com', 'elperiodico.com', 'expansion.com', 'freiepresse.de', 'independent.ie', 'irishtimes.com', 'la-croix.com', 'lne.es', 'marketwatch.com', 'nationalreview.com', 'noz.de', 'nwzonline.de', 'seekingalpha.com', 'shz.de', 'sueddeutsche.de', 'svz.de', 'telegraph.co.uk'].concat(au_news_corp_domains, au_nine_domains, de_madsack_domains, es_grupo_vocento_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_repubblica_domains, usa_mcc_domains, usa_theathletic_domains), header_referer)); } if (!isSiteEnabled(details) && !allow_ext_source && !bpc_amp_site && !au_apn_site && !au_swm_site) { diff --git a/changelog.txt b/changelog.txt index b4e4f6c..f22986d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ Post-release Add Il Giorno (Italy) Add L'Express (France) Add La Nazione (Italy) +Add The Athletic Remove Rheinische Post Mediengruppe (obsolete) Fix-update Madsack Mediengruppe (opt-in to custom sites for unlisted) Fix-update NyTeknik (images) diff --git a/contentScript.js b/contentScript.js index 74b7a08..91645d4 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2,7 +2,6 @@ var ext_api = (typeof browser === 'object') ? browser : chrome; var domain; var csDone = false; -var noMatch = false; var ca_torstar_domains = ['niagarafallsreview.ca', 'stcatharinesstandard.ca', 'thepeterboroughexaminer.com', 'therecord.com', 'thespec.com', 'thestar.com', 'wellandtribune.ca']; var de_funke_media_domains = ['abendblatt.de', 'braunschweiger-zeitung.de', 'morgenpost.de', 'nrz.de', 'otz.de', 'thueringer-allgemeine.de', 'tlz.de', 'waz.de', 'wp.de', 'wr.de']; @@ -253,7 +252,7 @@ else { } } else - noMatch = true; + csDone = true; } } else if (window.location.hostname.match(/\.(de|at|ch)$/) || matchDomain(['faz.net'])) {//germany/austria/switzerland - ch @@ -550,7 +549,7 @@ else if ((domain = matchDomain(de_madsack_domains)) || document.querySelector('l } else - noMatch = true; + csDone = true; } else if (window.location.hostname.match(/\.(es|pt)$/) || matchDomain(['diariovasco.com', 'elconfidencial.com', 'elcorreo.com', 'elespanol.com', 'elpais.com', 'elperiodico.com', 'expansion.com', 'larioja.com', 'lavanguardia.com', 'politicaexterior.com'])) {//spain/portugal @@ -747,7 +746,7 @@ else if (matchDomain('politicaexterior.com')) { } else - noMatch = true; + csDone = true; } else if (window.location.hostname.endsWith('.fr') || matchDomain(['bienpublic.com', 'journaldunet.com', 'la-croix.com', 'ledauphine.com', 'ledevoir.com', 'lejsl.com', 'nouvelobs.com', 'parismatch.com'])) {//france @@ -961,7 +960,7 @@ else if (matchDomain('sudouest.fr')) { } else - noMatch = true; + csDone = true; } else if (window.location.hostname.endsWith('.it') || matchDomain(['limesonline.com', 'quotidiano.net'])) {//italy @@ -1079,7 +1078,7 @@ else if (domain = matchDomain(it_repubblica_domains)) { } else - noMatch = true; + csDone = true; } else if (window.location.hostname.match(/\.(be|nl)$/)) {//belgium/netherlands @@ -1379,9 +1378,9 @@ else if (matchDomain('telegraaf.nl')) { } else - noMatch = true; + csDone = true; -} else if (window.location.hostname.match(/\.(ie|uk)$/) || matchDomain(['irishtimes.com'])) {//united kingdom/ireland +} else if (window.location.hostname.match(/\.(ie|uk)$/) || matchDomain(['irishtimes.com', 'theathletic.com'])) {//united kingdom/ireland if (matchDomain('irishtimes.com')) { document.addEventListener('DOMContentLoaded', () => { @@ -1436,6 +1435,24 @@ else if (matchDomain('the-tls.co.uk')) { removeDOMElement(paywall); } +else if (matchDomain(['theathletic.com', 'theathletic.co.uk'])) { + if (!window.location.href.includes('/?amp')) { + let paywall = document.querySelector('div#paywall-container'); + let amphtml = document.querySelector('link[rel="amphtml"]'); + if (paywall && amphtml) { + removeDOMElement(paywall); + window.location.href = amphtml.href; + } + } else { + let subscr_sections = document.querySelectorAll('[subscriptions-section="content"]'); + for (let subscr_section of subscr_sections) + subscr_section.removeAttribute('subscriptions-section'); + let subscr_actions = document.querySelectorAll('[subscriptions-actions]'); + removeDOMElement(...subscr_actions); + } +} + + else if (matchDomain('thetimes.co.uk')) { let block = document.querySelector('.subscription-block'); let ad_block = document.getElementById('ad-article-inline') @@ -1444,7 +1461,7 @@ else if (matchDomain('thetimes.co.uk')) { } else if (!matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) - noMatch = true; + csDone = true; } else if (window.location.hostname.match(/\.(br|cl|pe)$/) || matchDomain(['elmercurio.com', 'latercera.com', 'lasegunda.com'])) {//south america @@ -1502,7 +1519,7 @@ else if (matchDomain(["mercuriovalpo.cl", "estrellavalpo.cl"])) { } else - noMatch = true; + csDone = true; } else {//other (like com/org & not at/be/br/ch/cl/de/fr/es/ie/nl/pe/pt/uk)) @@ -1789,8 +1806,6 @@ else if (matchDomain('historyextra.com')) { } let ad_banner = document.querySelector('.ad-banner-container'); removeDOMElement(ad_banner); - if (ad_banner) - csDone = true; } else if (matchDomain('inkl.com')) { @@ -2014,8 +2029,11 @@ else if (matchDomain('nytimes.com')) { if (!close_button) login.classList.remove('nytc---modal-window---isShown'); } - } else + } else { + waitDOMElement('div[data-testid="inline-message"]', 'DIV', removeDOMElement, false); + waitDOMElement('div.expanded-dock', 'DIV', removeDOMElement, false); csDone = true; + } } else if (matchDomain('qz.com')) { @@ -2299,16 +2317,13 @@ else if ((domain = matchDomain(usa_mcc_domains)) || document.querySelector('scri } else - noMatch = true; -} - -if (noMatch) { csDone = true; - addDivBpcDone(); } -if (csDone) +if (csDone) { + addDivBpcDone(); ext_api.runtime.sendMessage({csDone: true}); +} } // end div_bpc_done diff --git a/manifest.json b/manifest.json index 1ae79cd..99862eb 100644 --- a/manifest.json +++ b/manifest.json @@ -403,6 +403,8 @@ "*://*.theadvocate.com.au/*", "*://*.theage.com.au/*", "*://*.theartnewspaper.com/*", + "*://*.theathletic.co.uk/*", + "*://*.theathletic.com/*", "*://*.theatlantic.com/*", "*://*.theaustralian.com.au/*", "*://*.thechronicle.com.au/*", @@ -500,5 +502,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.1.7.7" + "version": "2.1.7.8" } \ No newline at end of file diff --git a/sites.js b/sites.js index 9662f23..2909c0f 100644 --- a/sites.js +++ b/sites.js @@ -230,6 +230,7 @@ var defaultSites = "The Age": "theage.com.au", "The American Interest": "the-american-interest.com", "The Art Newspaper": "theartnewspaper.com", + "The Athletic": "###_usa_theathletic", "The Atlantic": "theatlantic.com", "The Australian Financial Review": "afr.com", "The Boston Globe (opt-in)": "bostonglobe.com", @@ -323,6 +324,7 @@ const nl_ad_region_domains = ['ad.nl', 'bd.nl', 'ed.nl', 'tubantia.nl', 'bndeste const usa_mcc_domains = ['bnd.com', 'charlotteobserver.com', 'fresnobee.com', 'kansas.com', 'kansascity.com', 'kentucky.com', 'newsobserver.com', 'sacbee.com', 'star-telegram.com', 'thestate.com', 'tri-cityherald.com']; const usa_nymag_domains = ['curbed.com', 'grubstreet.com', 'nymag.com', 'thecut.com', 'vulture.com']; const usa_tribune_domains = ['baltimoresun.com', 'chicagotribune.com', 'courant.com', 'dailypress.com', 'mcall.com', 'nydailynews.com', 'orlandosentinel.com', 'pilotonline.com', 'sun-sentinel.com']; +const usa_theathletic_domains = ['theathletic.com', 'theathletic.co.uk']; var defaultSites_grouped_domains = Object.values(defaultSites); -var defaultSites_domains = defaultSites_grouped_domains.concat(au_comm_media_domains, au_news_corp_domains, au_prov_news_domains, ca_torstar_domains, de_funke_media_domains, de_madsack_domains, es_grupo_vocento_domains, fi_alma_talent_domains, fr_be_groupe_rossel_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_ilmessaggero_domains, nl_ad_region_domains, usa_mcc_domains, usa_nymag_domains, usa_tribune_domains); +var defaultSites_domains = defaultSites_grouped_domains.concat(au_comm_media_domains, au_news_corp_domains, au_prov_news_domains, ca_torstar_domains, de_funke_media_domains, de_madsack_domains, es_grupo_vocento_domains, fi_alma_talent_domains, fr_be_groupe_rossel_domains, fr_groupe_ebra_domains, fr_groupe_la_depeche_domains, it_ilmessaggero_domains, nl_ad_region_domains, usa_mcc_domains, usa_nymag_domains, usa_tribune_domains, usa_theathletic_domains);