Skip to content

Instantly share code, notes, and snippets.

@dachev
Last active July 15, 2021 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dachev/05eeecd9ef4f2647fc3e522d94cce685 to your computer and use it in GitHub Desktop.
Save dachev/05eeecd9ef4f2647fc3e522d94cce685 to your computer and use it in GitHub Desktop.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};
function unmask() {
console.log('unmask');
// bloomberg
try {
document.body.style.overflow = 'scroll';
document.getElementById('fortress-paywall-container-root').remove();
document.getElementById('banner-container').remove();
}
catch(e) {}
// bloomberg
try {
document.body.style.overflow = 'scroll';
document.getElementById('fortress-modal-paywall-root').remove();
document.getElementById('banner-container').remove();
}
catch(e) {}
// bloomberg
try {
document.querySelector('#graphics-paywall-overlay').remove();
document.querySelector('body').setAttribute('data-paywall-overlay-status', 'hide');
}
catch(e) {}
// bloomberg
try {
document.getElementById('adBlockerContainer').remove();
document.querySelector('.paywall-inline-tout').remove();
document.querySelectorAll('.fence-body>p').forEach((el) => {
el.style.display = 'block';
});
}
catch(e) {}
// new york times
try {
document.querySelector('#gateway-content').remove();
document.querySelector('#app>div>div').style.overflow = "auto"
document.querySelectorAll('#app>div>div>div').forEach((el) => {
el.style.background = 'none';
})
}
catch(e) {}
// startribune
try {
document.querySelector('.ReactModalPortal').remove();
document.querySelector('body').style.overflow = "auto";
}
catch(e) {}
}
window.addEventListener('scroll', debounce(function() {
unmask();
}, 250));
unmask();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment