Skip to content

Instantly share code, notes, and snippets.

@Awk34
Created June 1, 2015 20:09
Show Gist options
  • Select an option

  • Save Awk34/fa0cdc9311c8fc12b635 to your computer and use it in GitHub Desktop.

Select an option

Save Awk34/fa0cdc9311c8fc12b635 to your computer and use it in GitHub Desktop.
Download an Egghead.io video and go to the next lesson
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();
@Awk34

Awk34 commented Jun 1, 2015

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment