Last active
December 16, 2015 02:49
-
-
Save amit/5365574 to your computer and use it in GitHub Desktop.
Ad remover
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 HQLive ad remover | |
// @description Version 1.2 - Remove annoying chat and ad iframes from hqlive | |
// @namespace http://hqlive.net/ | |
// @include http://*hqlive.net/* | |
// @include http://*cricket-365.tv/* | |
// @include http://*cricvid.com/* | |
// @include http://*cricvip.com/* | |
// @include http://*live365.tv/* | |
// Generic jQuery loader; callback is the real workhorse after jquery loading | |
function addJQuery(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script1 = document.createElement("script"); | |
script1.textContent = "(" + callback.toString() + ")();"; | |
document.body.appendChild(script1); | |
}, false); | |
document.body.appendChild(script); | |
} | |
// the guts of this userscript | |
function main() | |
{ | |
var badContainers = ['div#frame','div#hqcbx','div#hqosnn', 'div#pageshare', "div#HTML1", "div#HTML3", "div#HTML4", "#vad", "a.addthis_button", "#ad_container", "#ad_overlay", "div.post-share-buttons", "#bannerfloat7","#bannerfloat8", 'div#floatLayer1', "div#ads", "#video_ads_overdiv", 'div#sidebar', 'div.clear', 'div#chat']; | |
// , 'iframe@myfr']; | |
$.each(badContainers, function(idx,vlu) { | |
$(this).empty().hide().remove(); | |
}); | |
$('iframe').attr("allowTransparency", "false"); | |
window.setTimeout(main, 10*1000); | |
} | |
// load jQuery and execute the main function | |
addJQuery(main); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment