Last active
August 29, 2015 14:19
-
-
Save mplacona/6756660daaf33a71d87f to your computer and use it in GitHub Desktop.
Hack for /video page replay
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 heartbeat(){ | |
if(document.querySelector('.demo--completed') != null){ | |
eventFire(document.querySelector('.demo__restart'),'click'); | |
} | |
setTimeout(heartbeat,1000); | |
} | |
function eventFire(el, etype){ | |
if (el.fireEvent) { | |
(el.fireEvent('on' + etype)); | |
} else { | |
var evObj = document.createEvent('Events'); | |
evObj.initEvent(etype, true, false); | |
el.dispatchEvent(evObj); | |
} | |
} | |
heartbeat(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment