Skip to content

Instantly share code, notes, and snippets.

@amit
Last active December 16, 2015 02:49
Show Gist options
  • Save amit/5365574 to your computer and use it in GitHub Desktop.
Save amit/5365574 to your computer and use it in GitHub Desktop.
Ad remover
// ==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