From 674c1b4f48ba855c4f097c0bdb214ebc19ba786e Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 14 Jun 2021 21:45:26 +0200 Subject: [PATCH] Fix-update Boston Globe (no opt-in) --- background.js | 2 +- changelog.txt | 1 + contentScript.js | 22 +++++++++++++++------- manifest.json | 2 +- options/optin/opt-in.html | 1 - sites.js | 2 +- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/background.js b/background.js index e4441d1..271735a 100644 --- a/background.js +++ b/background.js @@ -280,7 +280,7 @@ var blockedRegexes = { 'billboard.com': /(cdn\.cxense\.com\/|\.tinypass\.com\/)/, 'bizjournals.com': /(assets\.bizjournals\.com\/static\/js\/app\/cxense\.js|cdn\.cxense\.com\/)/, 'bloomberg.com': /(\.tinypass\.com\/|assets\.bwbx\.io\/s3\/fence\/)/, - 'bostonglobe.com': /meter\.bostonglobe\.com\/js\//, + 'bostonglobe.com': /\.blueconic\.net\//, 'businessinsider.com': /\.tinypass\.com\//, 'challenges.fr': /\.poool\.fr\//, 'charliehebdo.fr': /\.poool\.fr\//, diff --git a/changelog.txt b/changelog.txt index 4a2c281..4f55c67 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix-update Boston Globe (no opt-in) * v2.2.5.0 (2021-06-13) Add The Wrap diff --git a/contentScript.js b/contentScript.js index 2ba2d0d..3465d94 100644 --- a/contentScript.js +++ b/contentScript.js @@ -25,7 +25,7 @@ var div_bpc_done = document.querySelector('div#bpc_done'); if (!div_bpc_done) { // listen to responses from background script -if (ext_api.runtime && (matchDomain(['belfasttelegraph.co.uk', 'bostonglobe.com', 'independent.ie']) || window.location.hostname.match(/\.(com|net)\.au$/))) { +if (ext_api.runtime && (matchDomain(['belfasttelegraph.co.uk', 'independent.ie']) || window.location.hostname.match(/\.(com|net)\.au$/))) { ext_api.runtime.onMessage.addListener(function (message, sender) { // setCookie opt-in if (message.optIn) { @@ -38,12 +38,7 @@ if (ext_api.runtime && (matchDomain(['belfasttelegraph.co.uk', 'bostonglobe.com' if (!cookieExists('subscribed')) setCookie('subscribed', 'true', domain, '/', 14); } else { - if (matchDomain('bostonglobe.com')) { - if (!cookieExists('s_fid')) { - let s_fid = genHexString(16) + '-' + genHexString(16); - setCookie('s_fid', s_fid, 'bostonglobe.com', '/', 14); - } - } else if (domain = matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) { + if (domain = matchDomain(['belfasttelegraph.co.uk', 'independent.ie'])) { if (!cookieExists('subscriber')) setCookie('subscriber', '{"subscriptionStatus": true}', domain, '/', 14); if (hostname.includes('amp.')) { @@ -1637,6 +1632,19 @@ else if (matchDomain('bloombergquint.com')) { removeDOMElement(articlesLeftModal, paywall); } +else if (matchDomain('bostonglobe.com')) { + let paywall = document.querySelector('div.meter-paywall'); + if (paywall) { + removeDOMElement(paywall); + let body_hidden = document.querySelector('body[style]'); + if (body_hidden) + body_hidden.removeAttribute('style'); + let continue_button = document.querySelector('button.continue_button'); + if (continue_button) + continue_button.click(); + } +} + else if (matchDomain('business-standard.com')) { document.addEventListener('DOMContentLoaded', () => { let skip_button = document.querySelector('a.btn_skip'); diff --git a/manifest.json b/manifest.json index 73f33ab..b8b443f 100644 --- a/manifest.json +++ b/manifest.json @@ -526,5 +526,5 @@ "*://*.wallkit.net/*", "*://*.wsj.net/*" ], - "version": "2.2.5.0" + "version": "2.2.5.1" } \ No newline at end of file diff --git a/options/optin/opt-in.html b/options/optin/opt-in.html index 5306ae7..e025454 100644 --- a/options/optin/opt-in.html +++ b/options/optin/opt-in.html @@ -15,7 +15,6 @@
setCookie opt-in
For some sites (check list in options) a necessary cookie has to be set (this cookie doesn't contain any personal information about the user or device):
Australian Provincial Newspapers
- Boston Globe
Irish Independent
The Belfast Telegraph
setCookie opt-in enabled:
diff --git a/sites.js b/sites.js index b633ce0..8d65d67 100644 --- a/sites.js +++ b/sites.js @@ -243,7 +243,7 @@ var defaultSites = "The Atlanta Journal-Constitution": "ajc.com", "The Atlantic": "theatlantic.com", "The Australian Financial Review": "afr.com", - "The Boston Globe (opt-in)": "bostonglobe.com", + "The Boston Globe": "bostonglobe.com", "The Business Journals": "bizjournals.com", "The Christian Science Monitor": "csmonitor.com", "The Daily Beast (free articles only)": "thedailybeast.com",