Created
June 29, 2016 04:07
-
-
Save yyaabboopp/c976468cef936c8f3693acfe23522c97 to your computer and use it in GitHub Desktop.
Disable YouTube Autoplay automatically
This file contains hidden or 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== | |
// @version 1.0.0 | |
// @name Autoplay Off | |
// @description Sets Autoplay to `Off` by default | |
// @include http*://*.youtube.com/* | |
// @run-at document-end | |
// @grant none | |
// @noframes | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
function disableAutoplay() { | |
setTimeout(function() { | |
var checkbox = document.getElementById('autoplay-checkbox'); | |
if (checkbox && checkbox.checked === true) { | |
checkbox.click(); | |
} | |
}, 2000); | |
} | |
window.addEventListener('readystatechange', disableAutoplay, true); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment