diff --git a/README.md b/README.md index fc74b8c..3e26be7 100755 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall [The Seattle Times](https://www.seattletimes.com) - [The News-Gazette](https://www.news-gazette.com) - [The Philadelphia Inquirer](https://www.inquirer.com) - -[The Sacramento Bee](https://www.sacbee.com)* - +[The Sacramento Bee](https://www.sacbee.com) - [Winston-Salem Journal](https://www.journalnow.com) #### Australia/New Zealand diff --git a/background.js b/background.js index 2b19367..fcd7aa0 100755 --- a/background.js +++ b/background.js @@ -199,6 +199,7 @@ var blockedRegexes = { 'nytimes.com': /(.+meter-svc\.nytimes\.com\/meter\.js.+|.+mwcm\.nyt\.com\/.+\.js)/, 'nzherald.co.nz': /nzherald\.co\.nz\/.+\/headjs\/.+\.js/, 'repubblica.it': /scripts\.repubblica\.it\/pw\/pw\.js.+/, +'sacbee.com': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/, 'science-et-vie.com': /.+\.qiota\.com\/.+/, 'sciencesetavenir.fr': /.+\.poool\.fr\/.+/, 'scmp.com': /.+\.tinypass\.com\/.+/, diff --git a/contentScript.js b/contentScript.js index 366bfa3..3b21a8b 100755 --- a/contentScript.js +++ b/contentScript.js @@ -1026,6 +1026,30 @@ else if (matchDomain("discovermagazine.com")) { removeDOMElement(banner); } +else if (matchDomain("sacbee.com")) { + let url = window.location.href; + if (url.includes('account.sacbee.com/paywall/')) { + window.setTimeout(function () { + window.location.href = 'https://amp.sacbee.com/article' + url.split('resume=')[1].split('#')[0] + '.html'; + }, 500); // Delay (in milliseconds) + } else if (url.includes('amp.sacbee.com')) { + let subscr_sections = document.querySelectorAll('div[subscriptions-section="content"]'); + for (let subscr_section of subscr_sections) { + subscr_section.removeAttribute('subscriptions-section'); + } + let subscr_tag = document.querySelector('div#subscriber-exclusive-tag'); + let amp_players = document.querySelectorAll('amp-connatix-player'); + removeDOMElement(subscr_tag, ...amp_players); + } + let premium_svgs = document.querySelectorAll('h3 > a > svg'); + let premium_link; + for (let premium_svg of premium_svgs) { + premium_link = premium_svg.parentElement; + if (premium_link.href.includes('www.')) + premium_link.href = premium_link.href.replace('www.', 'amp.'); + } +} + // General Functions function removeDOMElement(...elements) { for (let element of elements) { diff --git a/lp/manifest.json b/lp/manifest.json index 940d4a6..f86f413 100644 --- a/lp/manifest.json +++ b/lp/manifest.json @@ -290,5 +290,5 @@ "webRequest", "webRequestBlocking" ], - "version": "1.8.3.0" + "version": "1.8.3.1" } diff --git a/manifest.json b/manifest.json index f4ec9d3..dfa429a 100644 --- a/manifest.json +++ b/manifest.json @@ -21,5 +21,5 @@ "page": "options.html" }, "permissions": [ "cookies", "", "storage", "webRequest", "webRequestBlocking"], - "version": "1.8.3.0" + "version": "1.8.3.1" } diff --git a/sites.js b/sites.js index da24d0f..16e5245 100644 --- a/sites.js +++ b/sites.js @@ -170,7 +170,7 @@ var defaultSites = "The New Yorker": "newyorker.com", "The News-Gazette": "news-gazette.com", "The Philadelphia Inquirer": "inquirer.com", - "The Sacramento Bee (free articles only)": "sacbee.com", + "The Sacramento Bee": "sacbee.com", "The Saturday Paper": "thesaturdaypaper.com.au", "The Seattle Times": "seattletimes.com", "The Spectator": "spectator.co.uk",