Last active
May 8, 2020 20:28
-
-
Save garrappachc/ed61cb22e160cc2a6ac247b352950161 to your computer and use it in GitHub Desktop.
tf2center adblock fix
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 noads.js | |
// @namespace https://gist.githubusercontent.com/Garrappachc/ed61cb22e160cc2a6ac247b352950161/raw/44d44f12be88148a1cbc14617e205cacbb1035b3/noAds.js | |
// @description TF2Center adblock fix | |
// @include https://tf2center.com/lobbies | |
// @require https://gist.github.com/raw/2620135/checkForBadJavascripts.js | |
// @version 2 | |
// @run-at document-start | |
// @grant GM_addStyle | |
// ==/UserScript== | |
console.log ("Script run"); | |
function replaceTargetJavascript (scriptNode) { | |
var scriptSrc = scriptNode.textContent; | |
scriptSrc = scriptSrc.replace( | |
"const noAds=false;", | |
"const noAds=true;" | |
); | |
addJS_Node (scriptSrc); | |
} | |
checkForBadJavascripts ( [ | |
[ false, | |
/const noAds=false/, | |
replaceTargetJavascript | |
] | |
] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment