Skip to content

Instantly share code, notes, and snippets.

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 stormchasing/1ebb2e4c2e7c5733aeeb8bae2a7b083e to your computer and use it in GitHub Desktop.
Save stormchasing/1ebb2e4c2e7c5733aeeb8bae2a7b083e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name viralands chrome age verification extension blocker
// @namespace http://okstorms.com
// @version 1.0
// @description Attemtps to get rid of the creepy "age verification" extention installer they say you need to view the page in Chrome
// @author JR Hehnly (http://www.okstorms.com @stormchasing)
// @match http://www.viralands.com/*
// @grant none
// ==/UserScript==
function getElementsByClassName(oElm, strTagName, strClassName){
var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = [];
strClassName = strClassName.replace(/\-/g, "\\-");
var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
var oElement;
for(var i=0; i<arrElements.length; i++){
oElement = arrElements[i];
if(oRegExp.test(oElement.className)){
arrReturnElements.push(oElement);
}
}
return (arrReturnElements);
}
function runMe() {
// remove the overlay
var fancyBoxes = getElementsByClassName(document, 'div', 'fancybox-overlay fancybox-overlay-fixed');
if (fancyBoxes[0] !== undefined) {
fancyBoxes[0].parentNode.removeChild(fancyBoxes[0]);
}
// remove the class that disables scrolling
html = document.getElementsByTagName('html')[0];
html.className = '';
}
// run after the screen overlay has popped up
setTimeout(runMe, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment