Skip to content

Instantly share code, notes, and snippets.

@Yonezpt
Last active January 30, 2022 04:37
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • 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);
}());
@AlienVilliger
Copy link

How do you run this

@Zeryther
Copy link

@AlienVilliger once you have greasemonkey just click the "raw" button and greasemonkey asks you whether it should install this

@NHS-Whistleblower
Copy link

NHS-Whistleblower commented May 19, 2016

Thank you, thank you, THANK you. I am not particularly tech-y but I followed directions and tried it. It worked! FINALLY this horrible, horrible obnoxious YouTube auto-intrude feature is gone. It has been driving me mental. I have tried various useless suggestions and extensions from other things I've read and none have worked. This seems to have done exactly what I have been looking for and it's perfect. You are a Star!

@jymmm
Copy link

jymmm commented Dec 22, 2016

THANK YOU SO MUCH for this!!!

That "Up Next..." was just becoming so frickin annoying!!!

@grchannels
Copy link

grchannels commented Jan 17, 2017

Thank you, now i am calm from this annoying feature of yt!

@mario98
Copy link

mario98 commented Apr 30, 2017

Does not work....

@registerstuff777
Copy link

This works a charm, thanks. I had a go at tailoring your script to also stop www.bbc.co.uk videos from autoplaying, but failed miserably. Mainly because I don't know what I'm doing! Any chance you could oblige? Thanks in advance if you can.

@annadane
Copy link

Could you update this for the new Youtube layout please?

@jeffmbellucci
Copy link

jeffmbellucci commented Sep 12, 2017

Anyone is welcome to fork this one, or copy it into their script runner of choice.

https://gist.github.com/jeffmbellucci/8db3a8b27664dac6b8f9cf10b416b433

@annadane
Copy link

Jeff, your script doesn't seem to work in greasemonkey (copied the script).

@pilotrtc
Copy link

pilotrtc commented Oct 6, 2017

I tried Greasemonkey and Tampermonkey and the script did not work for me. Mac OS Sierra 10.12.6, Firefox 55.

@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