From 76405c8fc2414f0d03276eaad82b209a985f9b03 Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 27 Dec 2021 17:22:41 +0100 Subject: [PATCH] Fix group Tribune Publishing Company (js) --- README.md | 1 + background.js | 2 +- changelog.txt | 2 ++ contentScript.js | 10 +++++----- custom/manifest.json | 2 +- manifest.json | 6 ++++-- sites.js | 3 ++- sites_updated.json | 17 +++++++++++++++++ 8 files changed, 33 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7289d04..9cb2d72 100755 --- a/README.md +++ b/README.md @@ -263,6 +263,7 @@ Grouped in options:\ [The Press-Enterprise](https://www.pe.com)\ *Tribune Publishing Company* sites like\ [Baltimore Sun](https://www.baltimoresun.com) - +[Capital Gazette](https://www.capitalgazette.com) - [Chicago Tribune](https://www.chicagotribune.com) - [Daily Press](https://www.dailypress.com) - [Hartford Courant](https://www.courant.com) - diff --git a/background.js b/background.js index 3d61f2c..1e7ad68 100755 --- a/background.js +++ b/background.js @@ -635,7 +635,7 @@ var block_js = [ function disableJavascriptOnListedSites() { ext_api.webRequest.onBeforeRequest.addListener(function (details) { let header_referer = details.originUrl ? details.originUrl : details.initiator; - if (!isSiteEnabled(details) || matchUrlDomain(excludedSites.concat(['asia.nikkei.com']), header_referer)) { + if (!isSiteEnabled(details) || matchUrlDomain(excludedSites.concat(['asia.nikkei.com', 'cambridge.org']), header_referer)) { return; } return { diff --git a/changelog.txt b/changelog.txt index 0977d84..5c89c24 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,8 @@ Changelog Bypass Paywalls Clean - Chrome Post-release +Add Capital Gazette (local USA) +Fix group Tribune Publishing Company (js) * v2.4.9.0 (2021-12-26) Add El Espectador (Columbia) diff --git a/contentScript.js b/contentScript.js index ec4e4b9..53d8cb7 100755 --- a/contentScript.js +++ b/contentScript.js @@ -826,13 +826,13 @@ else if (matchDomain('elespanol.com')) { } } -else if (domain = matchDomain(es_unidad_domains)) { +else if (matchDomain(es_unidad_domains)) { let premium = document.querySelector('.ue-c-article__premium'); let url = window.location.href; - if (!url.includes('/amp.' + domain + '/')) { + if (!window.location.hostname.startsWith('amp.')) { if (premium) { removeDOMElement(premium); - window.location.href = window.location.href.replace('/www.', '/amp.'); + window.location.href = url.replace('/www.', '/amp.'); } } else { amp_unhide_access_hide('="authorized=true"', '="authorized!=true"'); @@ -849,8 +849,8 @@ else if (matchDomain('elpais.com')) { } else { let counter = document.querySelector('#counterLayerDiv'); removeDOMElement(counter); - let video = document.querySelector('div.videoTop') - let amphtml = document.querySelector('link[rel="amphtml"]'); + let video = document.querySelector('div.videoTop'); + let amphtml = document.querySelector('link[rel="amphtml"]'); if ((login_register || video) && amphtml) { removeDOMElement(login_register, video); window.location.href = amphtml.href; diff --git a/custom/manifest.json b/custom/manifest.json index 56e0930..f34d8c9 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -39,5 +39,5 @@ "webRequestBlocking", "" ], - "version": "2.4.9.0" + "version": "2.4.9.1" } diff --git a/manifest.json b/manifest.json index 0211796..33f1907 100755 --- a/manifest.json +++ b/manifest.json @@ -94,6 +94,7 @@ "*://*.businessoffashion.com/*", "*://*.cairnspost.com.au/*", "*://*.canberratimes.com.au/*", + "*://*.capitalgazette.com/*", "*://*.cen.acs.org/*", "*://*.centralwesterndaily.com.au/*", "*://*.centrepresseaveyron.fr/*", @@ -583,7 +584,8 @@ "*://*.rndtech.de/*", "*://*.sanoma-sndp.fi/*", "*://*.wallkit.net/*", - "*://*.wsj.net/*" + "*://*.wsj.net/*", + "*://*.zephr.com/*" ], - "version": "2.4.9.0" + "version": "2.4.9.1" } diff --git a/sites.js b/sites.js index 6c5d1d3..bbf972d 100755 --- a/sites.js +++ b/sites.js @@ -1648,6 +1648,7 @@ var defaultSites = { domain: "###_usa_tribune", group: [ "baltimoresun.com", + "capitalgazette.com", "chicagotribune.com", "courant.com", "dailypress.com", @@ -1658,7 +1659,7 @@ var defaultSites = { "sun-sentinel.com" ], allow_cookies: 1, - block_regex: /\.tribdss\.com\// + block_regex: /(\.tribdss\.com\/|\.zephr\.com\/zephr-browser\/.+\/zephr-browser\.umd\.js)/ }, "Trouw": { domain: "trouw.nl", diff --git a/sites_updated.json b/sites_updated.json index 229570c..5e7490c 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -49,5 +49,22 @@ "allow_cookies": 1, "amp_unhide": 1, "block_regex": "(\\/indianexpress\\.com\\/.+\\/indianexpress\\/js\\/evolok\\/.+\\.js|cdn\\.ampproject\\.org\\/v\\d\\/amp-(access|(sticky-)?ad)-.+\\.js)" + }, + "Tribune Publishing Company": { + "domain": "###_usa_tribune", + "group": [ + "baltimoresun.com", + "capitalgazette.com", + "chicagotribune.com", + "courant.com", + "dailypress.com", + "mcall.com", + "nydailynews.com", + "orlandosentinel.com", + "pilotonline.com", + "sun-sentinel.com" + ], + "allow_cookies": 1, + "block_regex": "(\\.tribdss\\.com\\/|\\.zephr\\.com\\/zephr-browser\\/.+\\/zephr-browser\\.umd\\.js)" } }