NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Allow Adblock
// @namespace https://openuserjs.org/users/pfpsgg
// @version 1.0.0
// @description Removes anti-adblock overlays and restores page scrolling on pfps.gg
// @author pfpsgg
// @license MIT
// @icon https://pfps.gg/assets/img/logo.svg
// @match https://pfps.gg/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
function unlockScroll() {
document.documentElement.style.setProperty('overflow', 'auto', 'important');
document.body.style.setProperty('overflow', 'auto', 'important');
document.documentElement.style.setProperty('position', 'static', 'important');
document.body.style.setProperty('position', 'static', 'important');
}
function handleSmellcheck(element) {
if (!element.classList.contains('hidden')) {
element.remove();
unlockScroll();
return true;
}
return false;
}
function setupObserver() {
const smellcheck = document.querySelector('#smellcheck');
if (smellcheck) {
// Check state immediately in case it's already visible
if (handleSmellcheck(smellcheck)) return;
// Watch for class attribute changes on #smellcheck
const attrObserver = new MutationObserver(() => {
if (handleSmellcheck(smellcheck)) {
attrObserver.disconnect();
}
});
attrObserver.observe(smellcheck, {
attributes: true,
attributeFilter: ['class']
});
} else {
// If #smellcheck isn't in the DOM yet, wait for it to be added
const domObserver = new MutationObserver((mutations, observer) => {
const target = document.querySelector('#smellcheck');
if (target) {
observer.disconnect();
setupObserver();
}
});
domObserver.observe(document.documentElement, {
childList: true,
subtree: true
});
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', setupObserver);
} else {
setupObserver();
}
})();