Remove NEXT video button from youtube auto play bar in HTML5 PLAYER

Removes the NEXT button from AUTO PLAY BAR of a HTML5 YouTube pLAYER.

  1. // ==UserScript==
  2. // @version 1.02
  3. // @author Maike André
  4. // @icon https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico
  5. // @name Remove NEXT video button from youtube auto play bar in HTML5 PLAYER
  6. // @description Removes the NEXT button from AUTO PLAY BAR of a HTML5 YouTube pLAYER.
  7. // @match https://*.youtube.com/*
  8. // @include http*://youtube.com/*
  9. // @include http*://*.youtu.be/*
  10. // @include http*://youtu.be/*
  11. // @run-at document-start
  12. // @grant none
  13. // @noframes
  14. // @namespace https://greasyfork.org/users/11421
  15. // ==/UserScript==
  16. (function () {
  17. 'use strict';
  18. function removeAPUN() {
  19. var autoplaybar = document.getElementsByClassName('ytp-play-button ytp-button')[0];
  20. if (autoplaybar) {
  21. //autoplaybar.removeAttribute('class');
  22. //document.getElementsByClassName('ytp-next-button ytp-button')[0].remove();
  23. document.getElementsByClassName('ytp-next-button')[0].remove();
  24. }
  25. }
  26. window.addEventListener('readystatechange', removeAPUN, true);
  27. window.addEventListener('spfdone', removeAPUN);
  28. }());