Fix Repubblica.it (remember to also disable uBlock Origin for this site)

This commit is contained in:
Adam 2022-04-11 21:27:25 -07:00
parent 3a837ab312
commit 0e81cdacfe

View File

@ -19,23 +19,16 @@ if (matchDomain('elmercurio.com')) {
removeDOMElement(paywall); removeDOMElement(paywall);
body.removeAttribute('style'); body.removeAttribute('style');
}, 300); // Delay (in milliseconds) }, 300); // Delay (in milliseconds)
} else if (matchDomain('repubblica.it')) { } else if (matchDomain('rep.repubblica.it')) {
document.addEventListener('DOMContentLoaded', () => { window.setTimeout(function () {
if (document.querySelector('#paywall')) { if (window.location.href.includes('/pwa/')) {
const url = window.location.href.split('?')[0]; window.location.href = window.location.href.replace('/pwa/', '/ws/detail/');
window.location.href = url + 'amp';
} else if (window.location.href.includes('/pwa/')) {
setTimeout(function () {
window.location.href = window.location.href.replace('/pwa/', '/ws/detail/');
}, 400);
} }
}); }, 500);
const paywall = document.querySelector('[subscriptions-section="content"]'); if (window.location.href.includes('/ws/detail/')) {
if (paywall) { const paywall = document.querySelector('.paywall');
paywall.removeAttribute('subscriptions-section'); if (paywall) {
const preview = document.querySelector('div[subscriptions-section="content-not-granted"]'); ampUnhideSubscriptionsSection();
if (preview) {
preview.remove();
} }
} }
} else if (matchDomain('americanbanker.com')) { } else if (matchDomain('americanbanker.com')) {