Last active
January 3, 2016 02:09
-
-
Save audibleblink/8394164 to your computer and use it in GitHub Desktop.
Minor cleanup and ad removal on firstrowus1.eu
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
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