Skip to content

Instantly share code, notes, and snippets.

@oxchronxo
Last active November 7, 2016 17:47
Show Gist options
  • Save oxchronxo/8296cccf974c5f0a851a467b23097239 to your computer and use it in GitHub Desktop.
Save oxchronxo/8296cccf974c5f0a851a467b23097239 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name typing club - no ads
// @namespace http://fehrenbacher.com
// @description remove ads
// @downloadUrl https://gist.github.com/oxchronxo/8296cccf974c5f0a851a467b23097239/raw/d98d53a2b0b35dceb2f6d970f850b75b58b8bd14/typingclub.user.js
// @include http*://*.typingclub.com/*
// @version 1.3
// @require http://code.jquery.com/jquery-1.11.1.min.js
// @require http://code.jquery.com/jquery-2.1.3.min.js
// @grant unsafeWindow
// ==/UserScript==
var noads = function () {
setTimeout(function () {
console.log("no ads running");
//document.getElementById("adunit").style.display="none";
var classNames = ["adsbygoogle"];
var popups = {};
var elements = [];
var element = null;
var indexA = 0;
var indexB = 0;
console.log("classNames", classNames);
for (indexA = 0; indexA < classNames.length; indexA++) {
elements = Array.prototype.slice.call(window.document.getElementsByClassName(classNames[indexA]));
console.log("elements", elements);
for (indexB = 0; indexB < elements.length; indexB++) {
element = elements[indexB];
console.log("element.className", element.className);
if (!(element.className in popups)) {
switch (element.className) {
case "adsbygoogle":
console.log("found " + adsbygoogle);
element.style.display="none";
break;
}
}
}
}
}, 5000);
};
$(document).ready(noads);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment