Last active
November 1, 2015 04:25
-
-
Save oxchronxo/a6ca3efb6da9ed436d90 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 roblox-no-ads | |
// @namespace https://gist.githubusercontent.com/oxchronxo/a6ca3efb6da9ed436d90/raw/17e8007d6d6baf785924a78dad2dc09d264c8090/roblox-ads | |
// @description removes ads | |
// @match *://*.roblox.com/* | |
// @include *://*.roblox.com/* | |
// @version 1 | |
// @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 | |
// ==/UserScript== | |
var robloxNoAds = function(){ | |
console.log("robloxNoAds running"); | |
document.getElementById("GamesPageRightColumn").style.display="none"; | |
console.log("robloxNoAds running more"); | |
document.getElementById("GamesPageLeftColumn").style.margin="0px 10px"; | |
console.log("robloxNoAds running more"); | |
var classNames = ["page-content", "right-abp", "left-abp"]; | |
var popups = {}; | |
var elements = []; | |
var element = null; | |
var indexA = 0; | |
var indexB = 0; | |
console.log("classNames", classNames); | |
for (indexA = 0; indexA < classNames.length; indexA++) { | |
elements = Array.prototype.slice.call(window.document.getElementsByClassName(classNames[indexA])); | |
console.log("elements", elements); | |
for (indexB = 0; indexB < elements.length; indexB++) { | |
element = elements[indexB]; | |
console.log("element.className", element.className); | |
if (!(element.className in popups)) { | |
//popups[element.className] = null; | |
//element.parentNode.removeChild(element); | |
switch (element.className) { | |
case "right-abp": | |
case "left-abp": | |
console.log("found left/right-abp"); | |
element.style.display="none"; | |
break; | |
case "page-content": | |
console.log("found page-content"); | |
element.style.maxWidth="auto"; | |
break; | |
} | |
} | |
} | |
} | |
}; | |
$(document).ready(robloxNoAds); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment