Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Zekfad/ed4f846bd51c8aff41f2cdaad24b21dd to your computer and use it in GitHub Desktop.
Save Zekfad/ed4f846bd51c8aff41f2cdaad24b21dd to your computer and use it in GitHub Desktop.
Kills the Admiral anti adblock nonsense. Just click on the *Raw* button to install the script into Tampermonkey.
// ==UserScript==
// @name Admiral AntiAdblock Killer
// @version 0.3
// @description Admiral AntiAdblock Killer
// @author Zekfad
// @match https://*/*
// @match http://*/*
// @grant none
// @updateURL https://gist.github.com/Zekfad/ed4f846bd51c8aff41f2cdaad24b21dd/raw/Admiral-AntiAdblock-Killer.user.js
// ==/UserScript==
(function() {
window.setInterval(() => {
if(document.getRootNode().children[0].style.overflow === "hidden" && document.getElementsByTagName("body")[0].style.overflow === "hidden") {
// Admiral Anti Adblock sets these properties when it activates.
// Search for the keyword to make sure it's actually the admiral anti-adblock. We don't want to clear the above properties if it's part of the page design.
const aTags = document.getElementsByTagName("H3");
const searchText = "It looks like you're using an adblocker";
let found;
for (let i = 0; i < aTags.length; i++) {
if (aTags[i].textContent == searchText) {
found = aTags[i];
break;
}
}
if(found){
// Loop until we've found the topmost element that's part of admiral.
while(found.parentElement.nodeName.toLowerCase() !== "body") {
found = found.parentElement;
}
// Remove that stupid element
found.remove();
console.info('Admiral AntiAdblock killed.');
// Enable the scrollbars again.
document.getRootNode().children[0].style.overflow = null;
document.getElementsByTagName("body")[0].style.overflow = null;
}
}
}, 100);
})();
@nuaimat
Copy link

nuaimat commented Nov 30, 2024

thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment