Skip to content

Instantly share code, notes, and snippets.

@SilverEzhik
Last active April 21, 2019 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SilverEzhik/8e6f2aad383d8baf27bbf196f57259de to your computer and use it in GitHub Desktop.
Save SilverEzhik/8e6f2aad383d8baf27bbf196f57259de to your computer and use it in GitHub Desktop.
YouTube is annoying in persistently switching autoplay back on, probably due to my cookie shennanigans, this fixes that.
// ==UserScript==
// @name Disable YouTube Autoplay
// @version 1
// @grant none
// @include https://*youtube.com/*
// @run-at document-idle
// ==/UserScript==
function fix() {
var a = document.getElementById("toggle");
if (a.getAttribute("aria-pressed") == "true") {
a.click();
}
}
setInterval(fix, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment