Startribune/TheAtlantic/SeattleTimes (#889)

* Add StarTribune

* Fix TheAtlantic

* Fix Seatle Times

* Fix WashingtonPost

* remove unnecessary space

* format with semistandard
This commit is contained in:
Nguyen 2020-09-14 22:45:06 -05:00 committed by GitHub
parent f5288a1d4e
commit acf454c5b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 2 deletions

View File

@ -109,6 +109,7 @@
[Seeking Alpha](https://seekingalpha.com)\
[SOFREP](https://sofrep.com)\
[Statista](https://www.statista.com)\
[Star Tribune](https://www.startribune.com)\
[SunSentinel](https://www.sun-sentinel.com)\
[Tech in Asia](https://www.techinasia.com)\
[Telegraaf](https://www.telegraaf.nl)\

View File

@ -228,7 +228,8 @@
"*://*.nzz.ch/*",
"*://*.republic.ru/*",
"*://*.historyextra.com/*",
"*://*.netdna-ssl.com/*"
"*://*.netdna-ssl.com/*",
"*://*.startribune.com/*"
],
"version": "1.7.5"
}

View File

@ -77,6 +77,14 @@ if (matchDomain('elmercurio.com')) {
const paywall = document.querySelector('.article__component.article__component--paywall-module-notification');
removeDOMElement(paywall);
} else if (matchDomain('washingtonpost.com')) {
//Remove all elements with the id contains 'paywall'
document.querySelectorAll('div[data-qa="paywall"]').forEach(function (el) {
removeDOMElement(el);
});
const html = document.querySelector('html');
html.removeAttribute('style');
const body = document.querySelector('body');
body.removeAttribute('style');
if (window.location.href.includes('/gdpr-consent/')) {
const freeButton = document.querySelector('.gdpr-consent-container .continue-btn.button.free');
if (freeButton) { freeButton.click(); }
@ -396,6 +404,39 @@ if (matchDomain('elmercurio.com')) {
const aboBanner = document.querySelector('[class^="pgxf3b"]');
removeDOMElement(aboBanner);
}, 500); // Delay (in milliseconds)
} else if (matchDomain('startribune.com')) {
// remove active class from all elements
document.querySelectorAll('div.ReactModalPortal').forEach(function (el) {
removeDOMElement(el);
});
//Enable Scroll. Reveal Hiddlen Paragraph
document.getElementsByTagName('body')[0].removeAttribute('class');
} else if (matchDomain('seattletimes.com')) {
window.setTimeout(function () {
// remove modal class from all elements
document.querySelectorAll('div.modal').forEach(function (el) {
removeDOMElement(el);
});
// Remove Blurred Style from all matching Divs
document.getElementById("container").removeAttribute("style");
document.querySelectorAll('div[style~="filter"]').forEach(function (el) {
el.removeAttribute('style');
});
document
.querySelectorAll('div[class~="NewsletterSignupSplash"]')
.forEach(function (el) {
el.removeAttribute('class');
});
}, 2000); // Delay (in milliseconds)
} else if (matchDomain("theatlantic.com")) {
//Remove all nudge elements
document.querySelectorAll('div[class*="c-nudge"]').forEach(function (el) {
removeDOMElement(el);
});
//Remove all FancyBox ads
document.querySelectorAll('div[class*="fancybox"]').forEach(function (el) {
removeDOMElement(el);
});
}
function matchDomain (domains) {
@ -423,4 +464,4 @@ function pageContains (selector, text) {
return Array.prototype.filter.call(elements, function (element) {
return RegExp(text).test(element.textContent);
});
}
}

View File

@ -84,6 +84,7 @@ const defaultSites = {
'Scientific American': 'scientificamerican.com',
'Seeking Alpha': 'seekingalpha.com',
'SOFREP': 'sofrep.com',
'Star Tribune': 'startribune.com',
'Statista': 'statista.com',
'SunSentinel': 'sun-sentinel.com',
'Tech in Asia': 'techinasia.com',