Skip to content

Instantly share code, notes, and snippets.

@audibleblink
Last active January 3, 2016 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audibleblink/8394164 to your computer and use it in GitHub Desktop.
Save audibleblink/8394164 to your computer and use it in GitHub Desktop.
Minor cleanup and ad removal on firstrowus1.eu
var CleanUp = {
init: function(){
this.stopTimers();
this.clearSpace();
this.clearAds();
},
stopTimers: function() {
for (var i = 1; i < 99999; i++) { window.clearInterval(i);}
},
// Only clears player ad divs created by firstrow, not ones placed in iframes
clearAds: function() {
var el = [ "ad_footer_content", "ad_footer", "ad_overlay_content", "ad_overlay", "banner_container" ];
for (var i = 0; i < el.length; i++) {
try {
document.getElementById(el[i]).remove();
}
catch(e) {
console.log( el[i] + " => This element does not currently exist" );
}
}
},
// Removes side bar and banners
clearSpace: function() {
var allTableData = document.getElementsByTagName('td');
for (var i = 0; i < allTableData.length; i++) {
allTableData[i].getAttribute('width') === "350" ? allTableData[i].remove() : false
}
document.getElementsByTagName('tr')[3].remove();
document.getElementsByTagName('tr')[1].remove();
}
};
CleanUp.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment