Created
May 15, 2012 23:29
-
-
Save hltbra/2705971 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==UserScript== | |
// @name Udacity EXT - Auto next video&quiz | |
// @description Udacity Extension -- Automatically go to the next video or quiz question upon reaching the end of the current one | |
// @namespace http://sepczuk.com/ | |
// @version 0.2 | |
// @include http://www.udacity.com/view* | |
// @match http://www.udacity.com/view* | |
// @copyright 2012, Damian Sepczuk, Hugo Lopes Tavares | |
// ==/UserScript== | |
function mainWrapper(){ | |
function main(){ | |
if (window.App.player === undefined) { | |
setTimeout(main, 300); | |
return; | |
} | |
App.player.addEventListener('onStateChange', function(p){ | |
if (p.data === YT.PlayerState.ENDED) { | |
$('#course-next-button .button').click(); | |
} | |
}) | |
}; | |
main(); | |
}; | |
if (!document.xmlVersion) { | |
var script = document.createElement('script'); | |
script.appendChild(document.createTextNode('('+ mainWrapper +')();')); | |
document.documentElement.appendChild(script); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok then.. =P