Skip to content

Instantly share code, notes, and snippets.

@Yonezpt
Last active September 6, 2024 05:10
Show Gist options
  • Save Yonezpt/51adf278a24488f75ff0 to your computer and use it in GitHub Desktop.
Save Yonezpt/51adf278a24488f75ff0 to your computer and use it in GitHub Desktop.
Removes the autoplay up next feature
// ==UserScript==
// @version 1.0.2
// @name Removes the autoplay up next feature
// @match *://www.youtube.com/*
// @run-at document-start
// @grant none
// @noframes
// ==/UserScript==
(function () {
'use strict';
function removeAPUN() {
var autoplaybar = document.getElementsByClassName('autoplay-bar')[0];
if (autoplaybar) {
autoplaybar.removeAttribute('class');
document.getElementsByClassName('checkbox-on-off')[0].remove();
}
}
window.addEventListener('readystatechange', removeAPUN, true);
window.addEventListener('spfdone', removeAPUN);
}());
@akohlsmith
Copy link

Thank you so very much. Worked perfectly.

@PintsizedSix40
Copy link

PintsizedSix40 commented Feb 23, 2019

Just found out I have a gist for this: https://gist.github.com/PintsizedSix40/6211833aba07a201919412e829297a2b
Just tested it and it works, if anyone needs it. It seems to work, despite being a few years old. I tried the other ones but they don't seem to work (maybe just firefox, idk). This just removes all the videos and the autoplay switch. There is still an open space there.

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