Skip to content

Instantly share code, notes, and snippets.

@mov-ebx
Last active April 13, 2023 14:54
Show Gist options
  • Save mov-ebx/3446c7a1a3600c8a1d9839ac8a3fd12d to your computer and use it in GitHub Desktop.
Save mov-ebx/3446c7a1a3600c8a1d9839ac8a3fd12d to your computer and use it in GitHub Desktop.
Userscript that blocks the annoying popup on RogueCheats asking you to turn off your adblock
// ==UserScript==
// @name RogueCheats Anti-Anti-Adblock
// @version 1.1
// @license MIT
// @description Blocks the annoying popup on RogueCheats asking you to turn off your adblock
// @author https://github.com/mov-ebx
// @match https://*.rogue.best/*
// @match https://*.math-for-the.win/*
// @grant none
// @namespace https://greasyfork.org/users/1059581
// ==/UserScript==
const ANTIAB_URLS = ["https://www.cdn4ads.com/waterfall.min.js", "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5077578545800134"];
async function antiantiAb() {
let isEnabled = false;
for (const url of ANTIAB_URLS) {
try {
await fetch(new Request(url)).catch((_)=>(isEnabled = true));
} catch {
isEnabled = true;
} finally {
if (isEnabled) {
Swal.close()
}
}
}
}
window.addEventListener("load", antiantiAb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment