Created
August 6, 2015 12:35
-
-
Save heyalexej/a1db552c8fa0fcd9e18c to your computer and use it in GitHub Desktop.
Quick & Dirty Chrome Extension to Skip Annoying Forbes Interstitial Ads
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
(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); | |
})(); |
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
{ | |
"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