Skip to content

Instantly share code, notes, and snippets.

@garrappachc
Last active May 8, 2020 20:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garrappachc/ed61cb22e160cc2a6ac247b352950161 to your computer and use it in GitHub Desktop.
Save garrappachc/ed61cb22e160cc2a6ac247b352950161 to your computer and use it in GitHub Desktop.
tf2center adblock fix
// ==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