diff --git a/README.md b/README.md index bb75e24..136710f 100644 --- a/README.md +++ b/README.md @@ -198,13 +198,17 @@ Grouped in options:\ [The Plain Dealer](https://www.cleveland.com) - [The Post-Standard](https://www.syracuse.com) - [The Republican](https://www.masslive.com)\ -*Gannett Group (local USA Today)* sites like (opt-in to custom sites)\ +*Gannett Group (local USA Today)* sites like (opt-in to custom sites for unlisted)\ [Austin American-Statesman](https://www.statesman.com/) - [Detroit Free Press](https://www.freep.com) - [Milwaukee Journal Sentinel](https://www.jsonline.com) - -[The Courier-Journal](https://www.courier-journal.com/) - +[The Arizona Republic](https://www.azcentral.com) - +[The Cincinnati Enquirer](http://www.cincinnati.com) - +[The Courier-Journal](https://www.courier-journal.com) - +[The Detroit News](https://www.detroitnews.com) - [The Indianapolis Star](https://www.indystar.com) - -[The Record (North Jersey)](https://www.northjersey.com)\ +[The Record (North Jersey)](https://www.northjersey.com) - +[The Tennessean](http://www.tennessean.com)\ *Lee Enterprises Group* sites like (opt-in to custom sites for unlisted)\ [Arizona Daily Star](https://tucson.com) - [Richmond Times-Dispatch](https://richmond.com) - diff --git a/background.js b/background.js index 7207b8a..207aacc 100644 --- a/background.js +++ b/background.js @@ -314,7 +314,7 @@ ext_api.storage.local.get({ defaultSites[site_updated_new] = updatedSites[site_updated_new]; if (ext_version > ext_version_old || updatedSites_new.length > 0) { if (enabledSites.includes('#options_enable_new_sites')) { - let sites_new = Object.keys(defaultSites).filter(x => defaultSites[x].domain && !defaultSites[x].domain.match(/^(#options_|###$)/) && !sites_default.includes(x)); + let sites_new = Object.keys(defaultSites).filter(x => defaultSites[x].domain && !defaultSites[x].domain.match(/^(#options_|###$)/) && !sites_default.some(key => compareKey(key, x))); for (let site_new of sites_new) sites[site_new] = defaultSites[site_new].domain; ext_api.storage.local.set({ @@ -678,7 +678,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) { } // set googlebot-useragent for Gannett sites - var usa_gannett_domains = []; + var usa_gannett_domains = grouped_sites['###_usa_gannett']; var usa_gannett_domain = (matchUrlDomain('gannett-cdn.com', details.url) && ['xmlhttprequest'].includes(details.type) && !matchUrlDomain(usa_gannett_domains.concat(['usatoday.com']), header_referer) && enabledSites.includes('###_usa_gannett')); if (usa_gannett_domain) { let gn_domain = urlHost(header_referer).replace(/^(www|eu)\./, '');; @@ -1078,8 +1078,10 @@ function site_switch() { var sites = items.sites; for (let key of added_site) sites[key] = domain; - for (let key of removed_site) + for (let key of removed_site) { + key = Object.keys(sites).find(sites_key => compareKey(sites_key, key)); delete sites[key]; + } ext_api.storage.local.set({ sites: sites }, function () { @@ -1279,6 +1281,10 @@ function filterObject(obj, filterFn, mapFn = function (val, key) { filter(([key, val]) => filterFn(val, key)).map(([key, val]) => mapFn(val, key))); } +function compareKey(firstStr, secondStr) { + return firstStr.toLowerCase().replace(/\s\(.*\)/, '') === secondStr.toLowerCase().replace(/\s\(.*\)/, ''); +} + function isSiteEnabled(details) { var enabledSite = matchUrlDomain(enabledSites, details.url); if (!ext_name.startsWith('Bypass Paywalls Clean')) diff --git a/changelog.txt b/changelog.txt index a25420c..f0ec9e8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Add Artnet Add Internazionale.it Fix The Business of Fashion Fix El Mundo & Groupe EBRA (amp-iframe) +Fix Gannett Group (permissions for listed sites) Fix Live Law (permission) Fix The New Yorker (amp) Fix TheTimes.co.uk (only link to archive.today) diff --git a/manifest.json b/manifest.json index 2ff6442..e011890 100644 --- a/manifest.json +++ b/manifest.json @@ -78,6 +78,7 @@ "*://*.atlantico.fr/*", "*://*.augsburger-allgemeine.de/*", "*://*.autonews.com/*", + "*://*.azcentral.com/*", "*://*.baltimoresun.com/*", "*://*.barrons.com/*", "*://*.bd.nl/*", @@ -115,6 +116,7 @@ "*://*.chicagotribune.com/*", "*://*.chronicle.com/*", "*://*.cicero.de/*", + "*://*.cincinnati.com/*", "*://*.clarin.com/*", "*://*.cleveland.com/*", "*://*.cmjornal.pt/*", @@ -123,6 +125,7 @@ "*://*.corriere.it/*", "*://*.corriereadriatico.it/*", "*://*.courant.com/*", + "*://*.courier-journal.com/*", "*://*.couriermail.com.au/*", "*://*.courrier-picard.fr/*", "*://*.crainscleveland.com/*", @@ -141,6 +144,7 @@ "*://*.demorgen.be/*", "*://*.denverpost.com/*", "*://*.destentor.nl/*", + "*://*.detroitnews.com/*", "*://*.deutsche-wirtschafts-nachrichten.de/*", "*://*.df.cl/*", "*://*.di.se/*", @@ -195,6 +199,7 @@ "*://*.foreignaffairs.com/*", "*://*.foreignpolicy.com/*", "*://*.fortune.com/*", + "*://*.freep.com/*", "*://*.freiepresse.de/*", "*://*.fresnobee.com/*", "*://*.ft.com/*", @@ -245,6 +250,7 @@ "*://*.inc.com/*", "*://*.inc42.com/*", "*://*.independent.ie/*", + "*://*.indystar.com/*", "*://*.informacion.es/*", "*://*.infzm.com/*", "*://*.inkl.com/*", @@ -257,6 +263,7 @@ "*://*.journaldunet.com/*", "*://*.journalnow.com/*", "*://*.jpost.com/*", + "*://*.jsonline.com/*", "*://*.kansas.com/*", "*://*.kansascity.com/*", "*://*.kauppalehti.fi/*", @@ -365,6 +372,7 @@ "*://*.nordeclair.fr/*", "*://*.nordlittoral.fr/*", "*://*.northerndailyleader.com.au/*", + "*://*.northjersey.com/*", "*://*.nouvelobs.com/*", "*://*.noz.de/*", "*://*.nrc.nl/*", @@ -438,6 +446,7 @@ "*://*.star-telegram.com/*", "*://*.staradvertiser.com/*", "*://*.startribune.com/*", + "*://*.statesman.com/*", "*://*.statista.com/*", "*://*.stcatharinesstandard.ca/*", "*://*.stocknews.com/*", @@ -456,6 +465,7 @@ "*://*.telegraaf.nl/*", "*://*.telegraph.co.uk/*", "*://*.telerama.fr/*", + "*://*.tennessean.com/*", "*://*.the-american-interest.com/*", "*://*.the-tls.co.uk/*", "*://*.theadvocate.com.au/*", @@ -572,5 +582,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.4.5.6" + "version": "2.4.5.7" } diff --git a/sites.js b/sites.js index 9815082..9a1ca62 100644 --- a/sites.js +++ b/sites.js @@ -34,7 +34,7 @@ var defaultSites = { domain: "adweek.com", block_regex: /\.lightboxcdn\.com\// }, - "Algemeen Dagblad (+ regional)": { + "Algemeen Dagblad (+ regional) (free premium articles only)": { domain: "###_nl_ad_region", group: [ "ad.nl", @@ -496,8 +496,22 @@ var defaultSites = { useragent: "googlebot", block_regex: /(cdn\.cxense\.com\/|\.tinypass\.com\/)/ }, - "Gannett Group (local USA Today) (opt-in to custom sites)": { - domain: "###_usa_gannett" + "Gannett Group (local USA Today)": { + domain: "###_usa_gannett", + group: [ + "azcentral.com", + "cincinnati.com", + "courier-journal.com", + "detroitnews.com", + "freep.com", + "indystar.com", + "jsonline.com", + "northjersey.com", + "statesman.com", + "tennessean.com" + ], + allow_cookies: 1, + useragent: "googlebot" }, "GElocal.it": { domain: "gelocal.it", @@ -634,7 +648,7 @@ var defaultSites = { block_regex: /haaretz\.co\.il\/htz\/js\/inter\.js/, useragent: "bingbot" }, - "Handelsblatt (only non-premium articles)": { + "Handelsblatt (non-premium articles only)": { domain: "handelsblatt.com", allow_cookies: 1, useragent: "googlebot"