Skip to content

Instantly share code, notes, and snippets.

@sug0
Last active September 20, 2017 16:25
Show Gist options
  • Save sug0/c94e716fbe69b4f0da5839cbadeee4d8 to your computer and use it in GitHub Desktop.
Save sug0/c94e716fbe69b4f0da5839cbadeee4d8 to your computer and use it in GitHub Desktop.
Userscript to disable the stupid youtube autoplay
// ==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