mirror of
https://github.com/iamadamdev/bypass-paywalls-chrome
synced 2025-05-01 15:24:26 +02:00
Fix technologyreview.com, wapo.com
This commit is contained in:
parent
044ed46fde
commit
c0fc6a98cd
@ -204,7 +204,8 @@ const blockedRegexes = {
|
|||||||
'latercera.com': /.+\.cxense\.com\/+/,
|
'latercera.com': /.+\.cxense\.com\/+/,
|
||||||
'lesechos.fr': /.+\.tinypass\.com\/.+/,
|
'lesechos.fr': /.+\.tinypass\.com\/.+/,
|
||||||
'washingtonpost.com': /.+\.washingtonpost\.com\/.+\/pwapi-proxy\.min\.js/,
|
'washingtonpost.com': /.+\.washingtonpost\.com\/.+\/pwapi-proxy\.min\.js/,
|
||||||
'thehindu.com': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/.+\/cloudflare-static\/rocket-loader\.min\.js/
|
'thehindu.com': /ajax\.cloudflare\.com\/cdn-cgi\/scripts\/.+\/cloudflare-static\/rocket-loader\.min\.js/,
|
||||||
|
'technologyreview.com': /.+\.blueconic\.net\/.+/
|
||||||
};
|
};
|
||||||
|
|
||||||
const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
|
const userAgentDesktop = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
|
||||||
|
@ -77,24 +77,17 @@ if (matchDomain('elmercurio.com')) {
|
|||||||
const paywall = document.querySelector('.article__component.article__component--paywall-module-notification');
|
const paywall = document.querySelector('.article__component.article__component--paywall-module-notification');
|
||||||
removeDOMElement(paywall);
|
removeDOMElement(paywall);
|
||||||
} else if (matchDomain('washingtonpost.com')) {
|
} else if (matchDomain('washingtonpost.com')) {
|
||||||
// Remove all elements with the id contains 'paywall'
|
const leaderboard = document.querySelector('#leaderboard-wrapper');
|
||||||
document.querySelectorAll('div[id^="paywall"]').forEach(function (el) {
|
const adverts = document.querySelectorAll('div[data-qa="article-body-ad"]');
|
||||||
removeDOMElement(el);
|
removeDOMElement(leaderboard, ...adverts);
|
||||||
});
|
|
||||||
const html = document.querySelector('html');
|
|
||||||
html.removeAttribute('style');
|
|
||||||
const body = document.querySelector('body');
|
|
||||||
body.removeAttribute('style');
|
|
||||||
if (window.location.href.includes('/gdpr-consent/')) {
|
if (window.location.href.includes('/gdpr-consent/')) {
|
||||||
const freeButton = document.querySelector('.gdpr-consent-container .continue-btn.button.free');
|
const freeButton = document.querySelector('.gdpr-consent-container .continue-btn.button.free');
|
||||||
if (freeButton) { freeButton.click(); }
|
if (freeButton) { freeButton.click(); }
|
||||||
|
window.setTimeout(function () {
|
||||||
setTimeout(function () {
|
|
||||||
const gdprcheckbox = document.querySelector('.gdpr-consent-container .consent-page:not(.hide) #agree');
|
const gdprcheckbox = document.querySelector('.gdpr-consent-container .consent-page:not(.hide) #agree');
|
||||||
if (gdprcheckbox) {
|
if (gdprcheckbox) {
|
||||||
gdprcheckbox.checked = true;
|
gdprcheckbox.checked = true;
|
||||||
gdprcheckbox.dispatchEvent(new Event('change'));
|
gdprcheckbox.dispatchEvent(new Event('change'));
|
||||||
|
|
||||||
document.querySelector('.gdpr-consent-container .consent-page:not(.hide) .continue-btn.button.accept-consent').click();
|
document.querySelector('.gdpr-consent-container .consent-page:not(.hide) .continue-btn.button.accept-consent').click();
|
||||||
}
|
}
|
||||||
}, 300); // Delay (in milliseconds)
|
}, 300); // Delay (in milliseconds)
|
||||||
@ -300,11 +293,16 @@ if (matchDomain('elmercurio.com')) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (matchDomain('technologyreview.com')) {
|
} else if (matchDomain('technologyreview.com')) {
|
||||||
// The class of banner is like 'overlayFooter__wrapper--3DhFn', which is hard to select exactly
|
window.setTimeout(function () {
|
||||||
const subscribeBanner = document.querySelector('[class*=overlayFooter__wrapper]');
|
const bodyObscured = document.querySelector('body[class*="body__obscureContent"]');
|
||||||
removeDOMElement(subscribeBanner);
|
if (bodyObscured) { removeClassesByPrefix(bodyObscured, 'body__obscureContent'); }
|
||||||
const body = document.querySelector('body');
|
const overlay = document.querySelector('div[class*="overlayFooter__wrapper"]');
|
||||||
removeClassesByPrefix(body, 'body__obscureContent');
|
if (overlay) { overlay.setAttribute('style', 'display:none'); }
|
||||||
|
const contentBodyHidden = document.querySelector('div[class*="contentBody__contentHidden"]');
|
||||||
|
if (contentBodyHidden) { removeClassesByPrefix(contentBodyHidden, 'contentBody__contentHidden'); }
|
||||||
|
const contentBodyOverlay = document.querySelector('div[class*="contentBody__overlay"]');
|
||||||
|
if (contentBodyOverlay) { contentBodyOverlay.removeAttribute('class'); }
|
||||||
|
}, 500);
|
||||||
} else if (matchDomain('leparisien.fr')) {
|
} else if (matchDomain('leparisien.fr')) {
|
||||||
window.removeEventListener('scroll', this.scrollListener);
|
window.removeEventListener('scroll', this.scrollListener);
|
||||||
const paywall = document.querySelector('.relative.piano-paywall.below_nav.sticky');
|
const paywall = document.querySelector('.relative.piano-paywall.below_nav.sticky');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user