Skip to content

Instantly share code, notes, and snippets.

@ErdbeerbaerLP
Last active April 8, 2024 18:56
Show Gist options
  • Save ErdbeerbaerLP/e76dbbf54d29fc7cad1be59506ff1104 to your computer and use it in GitHub Desktop.
Save ErdbeerbaerLP/e76dbbf54d29fc7cad1be59506ff1104 to your computer and use it in GitHub Desktop.
// ==UserScript==
//
// Install with Tampermonkey or Greasemonkey
//
// @name Aternos Anti AdBlock Blocker
// @version 1.0.5
// @description Blocks the anti ad block message and removes all red ad banners
// @author ErdbeerbaerLP
// @match https://aternos.org/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// @updateURL https://gist.github.com/ErdbeerbaerLP/e76dbbf54d29fc7cad1be59506ff1104/raw/Aternos%2520Anti%2520AdBlock%2520Blocker.user.js
// ==/UserScript==
(function() {
window.jQuery310 = $.noConflict(true);
function removeFilteredDivs(div){
if(div.className !== "body" && !document.body.getElementsByClassName("body")[0].contains(div) && !document.body.getElementsByClassName("header")[0].contains(div) && !(div.classList == "" && div.id == "")){
div.style = "display: none !important;"
}
}
function removeAllDivs(div){
div.style = "display: none !important;"
}
function deStyle(elmt){
if(elmt.classList.contains("ad") || elmt.classList == "" || elmt.id == "") return;
var styl = elmt.style;
if(styl.display === "none") styl.setProperty("display", "initial");
console.log(styl.important);
styl.setProperty("important", "initial");
elmt.style = styl;
}
function main(){
document.body.getElementsByClassName("header")[0].style = "";
Array.prototype.slice.call(document.body.getElementsByTagName("div")).forEach(removeFilteredDivs);
Array.prototype.slice.call(document.body.getElementsByClassName("ad")).forEach(removeAllDivs);
Array.prototype.slice.call(document.body.querySelectorAll('*')).forEach(deStyle);
}
function enableStart(){
$('#start').each(function () {
this._ready = true;
})
}
var interval = setInterval(main, 10);
function clearIv(){
clearInterval(interval)
}
setTimeout(enableStart, 500);
setTimeout(clearIv,6000); //Stop processing that after 6 seconds
})();
@amirulhakim09
Copy link

doesn't work

yeah, it's work for the first time but after that it's broken again...

@Ampere102
Copy link

do this in console and then enter

@Hakorr
Copy link

Hakorr commented Dec 14, 2021

The developers track down these scripts and patch them, any public script is in danger of being patched.

I'd recommend building your own userscript using my guide here.

@DvilMuck
Copy link

DvilMuck commented Feb 7, 2022

After much research without success of a working userscript, I decided to make my own anti anti-adblock. Give it a try!
To annoy Aternos devs it's obfuscated, also prevents easy patching. Sorry!

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