Last active
April 13, 2023 14:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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