Skip to content

Instantly share code, notes, and snippets.

@heyalexej
Created August 6, 2015 12:35
Show Gist options
  • Save heyalexej/a1db552c8fa0fcd9e18c to your computer and use it in GitHub Desktop.
Save heyalexej/a1db552c8fa0fcd9e18c to your computer and use it in GitHub Desktop.
Quick & Dirty Chrome Extension to Skip Annoying Forbes Interstitial Ads
(function (){
function log(t){
console.log("ForbesSkip: " + t);
}
function tryAgain(f){
log("Not fully loaded yet, try again.");
window.setTimeout(f, 200);
}
function skipIt(){
log("Started");
var continues = document.getElementsByClassName('continue');
var cLink = null;
for (var i = 0; i < continues.length; i++) {
var elem = continues[i];
if (elem.nodeName == 'a') {
cLink = elem;
break;
}
}
if (cLink == null) {
tryAgain(skipIt);
return;
}
cLink.click();
log("Finished!");
}
log("Loaded.");
window.setTimeout(skipIt, 5);
})();
{
"name": "Skip Forbes Ad",
"manifest_version": 2,
"version": "0.1.0",
"description": "Skips frickin' annoying interstitial ad page on forbes.com",
"content_scripts": [
{
"matches": [
"http://www.forbes.com/fdc/welcome_mjx.shtml"
],
"js": [
"contentscript.js"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment