Skip to content

Instantly share code, notes, and snippets.

@erikvold
Created March 13, 2010 03:39
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 erikvold/331085 to your computer and use it in GitHub Desktop.
Save erikvold/331085 to your computer and use it in GitHub Desktop.
This userscript removes ads from the Wall Street Journal, if it misses any let me know.
// ==UserScript==
// @name Wall Street Journal Ad Remover
// @namespace wsjAdRemover
// @include http://*.wsj.com/*
// @include http://wsj.com/*
// @include https://*.wsj.com/*
// @include https://wsj.com/*
// @match http://*.wsj.com/*
// @match http://wsj.com/*
// @match https://*.wsj.com/*
// @match https://wsj.com/*
// @datecreated 2010-03-12
// @lastupdated 2010-03-12
// @version 0.1
// @author Erik Vergobbi Vold
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @description This userscript removes ads from the Wall Street Journal, if it misses any let me know.
// ==/UserScript==
(function(d){
var adRemoverFunc = function(){
var classNameAry = ['advertisement', 'adSummary', 'specialAdvertising', 'emailSignUp', 'ad_artBottomCircMarketing'],
tempEle, tempEles;
// remove known ad class names
for (var i = 0; i < classNameAry.length; i++) {
tempEles = d.getElementsByClassName(classNameAry[i]);
for (var j = 0; j < tempEles.length; j++) {
tempEles[j].parentNode.removeChild(tempEles[j]);
}
}
}
window.addEventListener( "load", adRemoverFunc, false );
adRemoverFunc();
setTimeout( adRemoverFunc, 2000 );
})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment