Merge pull request #341 from cimke/feature/remove-medium-footer

Remove medium sticky footer
This commit is contained in:
ghost 2019-11-10 11:39:43 -08:00 committed by GitHub
commit dadb9f2e30

View file

@ -99,6 +99,13 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) {
}
}
if (window.location.href.indexOf("medium.com") !== -1) {
const bottomMessageText = 'Get one more story in your member preview when you sign up. Its free.';
const DOMElementsToTextDiv = pageContains('div', bottomMessageText);
if (DOMElementsToTextDiv[2]) removeDOMElement(DOMElementsToTextDiv[2]);
}
if (window.location.href.indexOf("bloombergquint.com") !== -1) {
const articlesLeftModal = document.getElementsByClassName('paywall-meter-module__story-paywall-container__1UgCE')[0];
const paywall = document.getElementById('paywallDmp');
@ -158,3 +165,11 @@ function removeDOMElement(...elements) {
if (element) element.remove();
}
}
function pageContains(selector, text) {
let elements = document.querySelectorAll(selector);
return Array.prototype.filter.call(elements, function(element){
return RegExp(text).test(element.textContent);
});
}