Fix Boston Globe support without cookie tampering, is relatively fast. (#1220)

Co-authored-by: billatq <8d8k@anmt.net>
This commit is contained in:
billatq 2021-07-02 22:12:54 -04:00 committed by GitHub
parent 167d1420d3
commit 8aa8f4ed1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 1 deletions

View File

@ -34,6 +34,7 @@
[Bloomberg Quint](https://www.bloombergquint.com)\ [Bloomberg Quint](https://www.bloombergquint.com)\
[Bloomberg](https://www.bloomberg.com)\ [Bloomberg](https://www.bloomberg.com)\
[BN De Stem](https://www.bndestem.nl)\ [BN De Stem](https://www.bndestem.nl)\
[Boston Globe](https://www.bostonglobe.com)\
[Brabants Dagblad](https://www.bd.nl)\ [Brabants Dagblad](https://www.bd.nl)\
[Brisbane Times](https://www.brisbanetimes.com.au)\ [Brisbane Times](https://www.brisbanetimes.com.au)\
[Business Insider](https://www.businessinsider.com)\ [Business Insider](https://www.businessinsider.com)\

View File

@ -72,7 +72,8 @@
"*://*.elmundo.es/*", "*://*.elmundo.es/*",
"*://*.time.com/*", "*://*.time.com/*",
"*://*.expansion.com/*", "*://*.expansion.com/*",
"*://*.foreignpolicy.com/*" "*://*.foreignpolicy.com/*",
"*://*.bostonglobe.com/*"
], ],
"js": ["src/js/contentScript.js"] "js": ["src/js/contentScript.js"]
} }

View File

@ -661,6 +661,25 @@ if (matchDomain('elmercurio.com')) {
if (contentGated) { if (contentGated) {
contentGated.classList.remove('content-gated'); contentGated.classList.remove('content-gated');
} }
} else if (matchDomain('bostonglobe.com')) {
// Remove the portion covering the paywall
const paywall = document.querySelector('div.meter-paywall')
if (paywall) {
removeDOMElement(paywall)
}
// Re-enable scrolling
const body = document.querySelector('body')
if (body) {
document.body.removeAttribute('style')
}
// Click the button to reveal the rest of the article
const buttonDiv = document.querySelector('[id="continue_button"]')
if (buttonDiv) {
const button = buttonDiv.querySelector('button')
if (button) {
button.click()
}
}
} }
function matchDomain (domains) { function matchDomain (domains) {

View File

@ -9,6 +9,7 @@ const defaultSites = {
'Bloomberg': 'bloomberg.com', 'Bloomberg': 'bloomberg.com',
'Bloomberg Quint (free articles only)': 'bloombergquint.com', 'Bloomberg Quint (free articles only)': 'bloombergquint.com',
'BN De Stem': 'bndestem.nl', 'BN De Stem': 'bndestem.nl',
'Boston Globe': 'bostonglobe.com',
'Brabants Dagblad': 'bd.nl', 'Brabants Dagblad': 'bd.nl',
'Brisbane Times': 'brisbanetimes.com.au', 'Brisbane Times': 'brisbanetimes.com.au',
'Business Insider': 'businessinsider.com', 'Business Insider': 'businessinsider.com',