Skip to content

Instantly share code, notes, and snippets.

@garrappachc garrappachc/noAds.js
Last active Sep 23, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.