Created
June 17, 2016 16:23
-
-
Save sfate/bb8064f10659a386e0f29904ecc4b294 to your computer and use it in GitHub Desktop.
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() { 'use strict'; | |
var currentTimeEl = document.querySelector('.ytp-time-current'), | |
endTimeEl = document.querySelector('.ytp-time-duration'), | |
replayBtnEl = document.querySelector('.ytp-play-button'); | |
setTimeout(function replay() { | |
if ( | |
(currentTimeEl.textContent == endTimeEl.textContent) | |
&& | |
(replayBtnEl.getAttribute('title') == 'Replay') | |
) { | |
replayBtnEl.click(); | |
} | |
setTimeout(replay, 1000); | |
}, 1000) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment