Created
June 1, 2015 20:09
-
-
Save Awk34/fa0cdc9311c8fc12b635 to your computer and use it in GitHub Desktop.
Download an Egghead.io video and go to the next lesson
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 fireEvent(el, etype){ | |
if (el.fireEvent) { | |
el.fireEvent('on' + etype); | |
} else { | |
var evObj = document.createEvent('Events'); | |
evObj.initEvent(etype, true, false); | |
el.dispatchEvent(evObj); | |
} | |
} | |
function downloadAndGoToNext() { | |
fireEvent(document.getElementById('pro-download'), 'click'); | |
setTimeout(function() { | |
fireEvent(document.querySelector('.next-lesson a'), 'click'); | |
}, 1000); | |
} | |
downloadAndGoToNext(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paste this into your console (enable preserve log) and hit enter. It should click the download button, and after a 1s delay hit the next lesson link. Once at the next lesson, simply hit the up arrow in your console to get the last command input and hit enter again.