Last active
September 20, 2017 16:25
-
-
Save sug0/c94e716fbe69b4f0da5839cbadeee4d8 to your computer and use it in GitHub Desktop.
Userscript to disable the stupid youtube autoplay
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 YouTube Autoplay | |
// @namespace https://gandas.us.to/ | |
// @version 0.4 | |
// @description Disable the stupid youtube autoplay | |
// @author sugoiuguu | |
// @match http://www.youtube.com/watch* | |
// @match https://www.youtube.com/watch* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var ytd; | |
function disableAutoplay() { | |
ytd = document.getElementById('toggle'); | |
if (!ytd) { | |
setTimeout(disableAutoplay, 1000); | |
} else { | |
if (ytd.checked) { | |
ytd.click(); | |
console.log('disabled autoplay'); | |
} | |
} | |
}; | |
disableAutoplay(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment