Skip to content

Instantly share code, notes, and snippets.

@GoldenretriverYT
Last active August 31, 2023 13:02
Show Gist options
  • Save GoldenretriverYT/0e41398bf96aa45317d38842002ecaf3 to your computer and use it in GitHub Desktop.
Save GoldenretriverYT/0e41398bf96aa45317d38842002ecaf3 to your computer and use it in GitHub Desktop.
no polytoria adblock banner
// ==UserScript==
// @name no adblock banner (regurlarly update it ig)
// @namespace Violentmonkey Scripts
// @match https://polytoria.com/*
// @grant none
// @version 1.0
// @author sussex
// @description 31.8.2023, 14:38:31
// @run-at document-start
// ==/UserScript==
function traverseUpUntil(cond, within) {
if(cond(within)) return within;
return traverseUpUntil(cond, within.parentElement);
}
const observer = new MutationObserver(list => {
let res = document.evaluate("//b[contains(., 'adblocker')]", document.body);
while(true) {
let el = res.iterateNext();
if(el == null) break;
console.log(el);
traverseUpUntil((el) => el.style.position == "sticky", el).remove();
}
});
observer.observe(document.documentElement || document.body, {attributes: true, childList: true, subtree: true});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment