Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==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
You can’t perform that action at this time.