Skip to content

Instantly share code, notes, and snippets.

@copleykj
Created July 28, 2015 13:23
Show Gist options
  • Save copleykj/1f285d6720cff0a90603 to your computer and use it in GitHub Desktop.
Save copleykj/1f285d6720cff0a90603 to your computer and use it in GitHub Desktop.
//Join into single line and add to chrome or firefox as a bookmark and run on lynda video page with html5 video enabled
//will not work with lynda's flash video player
javascript:(function(){
var vdoUrl = $("video").attr("h264");
var link = document.createElement('a');
link.href = vdoUrl;
var fileName = vdoUrl.substring(vdoUrl.lastIndexOf('/') + 1, vdoUrl.length);
link.download = fileName;
var e = document.createEvent('MouseEvents');
e.initEvent('click' ,true ,true);
link.dispatchEvent(e);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment