Formatting

This commit is contained in:
Adam 2020-09-14 20:46:32 -07:00
parent acf454c5b7
commit 7dbd4201a9

View File

@ -77,14 +77,14 @@ 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' // Remove all elements with the id contains 'paywall'
document.querySelectorAll('div[data-qa="paywall"]').forEach(function (el) { document.querySelectorAll('div[data-qa="paywall"]').forEach(function (el) {
removeDOMElement(el); removeDOMElement(el);
}); });
const html = document.querySelector('html'); const html = document.querySelector('html');
html.removeAttribute('style'); html.removeAttribute('style');
const body = document.querySelector('body'); const body = document.querySelector('body');
body.removeAttribute('style'); 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(); }
@ -405,38 +405,38 @@ if (matchDomain('elmercurio.com')) {
removeDOMElement(aboBanner); removeDOMElement(aboBanner);
}, 500); // Delay (in milliseconds) }, 500); // Delay (in milliseconds)
} else if (matchDomain('startribune.com')) { } else if (matchDomain('startribune.com')) {
// remove active class from all elements // remove active class from all elements
document.querySelectorAll('div.ReactModalPortal').forEach(function (el) { document.querySelectorAll('div.ReactModalPortal').forEach(function (el) {
removeDOMElement(el); removeDOMElement(el);
}); });
//Enable Scroll. Reveal Hiddlen Paragraph // Enable Scroll. Reveal Hiddlen Paragraph
document.getElementsByTagName('body')[0].removeAttribute('class'); document.getElementsByTagName('body')[0].removeAttribute('class');
} else if (matchDomain('seattletimes.com')) { } else if (matchDomain('seattletimes.com')) {
window.setTimeout(function () { window.setTimeout(function () {
// remove modal class from all elements // remove modal class from all elements
document.querySelectorAll('div.modal').forEach(function (el) { document.querySelectorAll('div.modal').forEach(function (el) {
removeDOMElement(el); removeDOMElement(el);
}); });
// Remove Blurred Style from all matching Divs // Remove Blurred Style from all matching Divs
document.getElementById("container").removeAttribute("style"); document.getElementById('container').removeAttribute('style');
document.querySelectorAll('div[style~="filter"]').forEach(function (el) { document.querySelectorAll('div[style~="filter"]').forEach(function (el) {
el.removeAttribute('style'); el.removeAttribute('style');
}); });
document document
.querySelectorAll('div[class~="NewsletterSignupSplash"]') .querySelectorAll('div[class~="NewsletterSignupSplash"]')
.forEach(function (el) { .forEach(function (el) {
el.removeAttribute('class'); el.removeAttribute('class');
}); });
}, 2000); // Delay (in milliseconds) }, 2000); // Delay (in milliseconds)
} else if (matchDomain("theatlantic.com")) { } else if (matchDomain('theatlantic.com')) {
//Remove all nudge elements // Remove all nudge elements
document.querySelectorAll('div[class*="c-nudge"]').forEach(function (el) { document.querySelectorAll('div[class*="c-nudge"]').forEach(function (el) {
removeDOMElement(el); removeDOMElement(el);
}); });
//Remove all FancyBox ads // Remove all FancyBox ads
document.querySelectorAll('div[class*="fancybox"]').forEach(function (el) { document.querySelectorAll('div[class*="fancybox"]').forEach(function (el) {
removeDOMElement(el); removeDOMElement(el);
}); });
} }
function matchDomain (domains) { function matchDomain (domains) {
@ -464,4 +464,4 @@ function pageContains (selector, text) {
return Array.prototype.filter.call(elements, function (element) { return Array.prototype.filter.call(elements, function (element) {
return RegExp(text).test(element.textContent); return RegExp(text).test(element.textContent);
}); });
} }