Last active
August 27, 2017 21:04
-
-
Save uahim/9fa6264ccf7425f17a89e3c8d1121d8b 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
// ==UserScript== | |
// @name stop (actually: pause) youtube html5 player on loading | |
// @author mihau | |
// @version 0.1 | |
// @include http*://*.youtube.com/* | |
// @include http*://youtube.com/* | |
// ==/UserScript== | |
function ytstop() { | |
setTimeout("buttoncheck()", 200); | |
} | |
function buttoncheck() { | |
if (document.getElementsByClassName('ytp-play-button')[0].getAttribute('aria-label') == 'Pause') { | |
setTimeout("document.getElementsByClassName('ytp-play-button')[0].click()", 200); | |
} else { | |
buttoncheck(); | |
} | |
} | |
window.addEventListener('DOMContentLoaded', ytstop, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment