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
})();
@gamernoob24
Copy link

yes it was good but there is some update to the website

the anti adblock popup always annoy me

can you update the javascript?

@ErdbeerbaerLP
Copy link
Author

I tried a while and could not yet find a way to fix that. (Mostly because of my currently pretty-much-not-working internet connection)

@XfedeX
Copy link

XfedeX commented Feb 21, 2021

Try making a sort of auto-clicker that auto-clicks the "skip ads" button, and just hide the banner without destroying it.

@XfedeX
Copy link

XfedeX commented Mar 12, 2021

@ErdbeerbaerLP Have you tried that?

@amirulhakim09
Copy link

amirulhakim09 commented May 24, 2021

it's work for me!
thanks!
just turn of the adblocker and it will done!

@SakhJack
Copy link

doesn't work

@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