Last active
October 16, 2015 15:57
-
-
Save oxchronxo/3d2f44e1735f24e6cc7e to your computer and use it in GitHub Desktop.
This file contains 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 tunein-no-popups | |
// @namespace https://gist.githubusercontent.com/oxchronxo/3d2f44e1735f24e6cc7e/raw/ae3e713302453cbbab02527d7574574d9bee29d9/tunein-ads | |
// @description remove popups | |
// @version 1 | |
// @author Eric Fehrenbacher | |
// @match *://*.tunein.com/* | |
// @require http://code.jquery.com/jquery-1.11.1.min.js | |
// @require http://code.jquery.com/jquery-2.1.3.min.js | |
// @noframes | |
// @grant unsafeWindow | |
// @run-at document-body | |
// ==/UserScript== | |
$(document).ready(function(){ | |
setTimeout(function() { | |
var classNames = ["modal-dialog", "popup", "conversion-modal"]; | |
var popups = {}; | |
var elements = []; | |
var element = null; | |
var indexA = 0; | |
var indexB = 0; | |
for (indexA = 0; indexA < classNames.length; indexA++) { | |
elements = Array.prototype.slice.call(window.document.getElementsByClassName(classNames[indexA])); | |
for (indexB = 0; indexB < elements.length; indexB++) { | |
element = elements[indexB]; | |
if (!(element.className in popups)) { | |
popups[element.className] = null; | |
element.parentNode.removeChild(element); | |
} | |
} | |
} | |
}, 5000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment