Skip to content

Instantly share code, notes, and snippets.

@jeffmbellucci
Last active February 15, 2026 14:31
Show Gist options
  • Select an option

  • Save jeffmbellucci/8db3a8b27664dac6b8f9cf10b416b433 to your computer and use it in GitHub Desktop.

Select an option

Save jeffmbellucci/8db3a8b27664dac6b8f9cf10b416b433 to your computer and use it in GitHub Desktop.
Turn off/disable YouTube autoplay feature
// To run, install GreaseMonkey or TamperMonkey extension in your browser
// Copy this code into new user script, and enable
// ==UserScript==
// @name Disable Youtube autoplay
// @version 1.0
// @description This script turns off Youtube's newest autoplay feature after the page loads
// @author Jeff Bellucci
// @match *://www.youtube.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
function uncheck(toggle) {
if (toggle.hasAttribute('checked')) {
toggle.click();
}
}
function disableAfterLoad() {
var autoplayToggle = document.getElementById('toggle');
if (autoplayToggle) {
uncheck(autoplayToggle);
} else {
setTimeout(disableAfterLoad, 500);
}
}
disableAfterLoad();
})();
@DBGx64
Copy link

DBGx64 commented Feb 15, 2026

it doesn't block autoplay current video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment