Stop YouTube Video Download

Stops YouTube Video From Downloading.

  1. // ==UserScript==
  2. // @name Stop YouTube Video Download
  3. // @namespace http://userscripts.org/users/sknepal
  4. // @description Stops YouTube Video From Downloading.
  5. // @include http://*.youtube.com/*
  6. // @include http://youtube.com/*
  7. // @include https://*.youtube.com/*
  8. // @include https://youtube.com/*
  9. // @grant none
  10. // @version 1.3
  11. // ==/UserScript==
  12.  
  13. /* CHANGE LOG
  14. 1.3 (9/27/2014) : removed return statement that was causing the error.
  15. 1.2 (1/27/2014) : made it support Youtube 'red bar' feature (SPF).
  16. thanks to JoeSimmons for the idea : http://userscripts.org/scripts/show/174846
  17. 1.1 (08/18/2013) : removed pauseVideo option.
  18. 1.0 (07/21/2013) : created.
  19.  
  20. */
  21.  
  22. var btn_id = 'stop-download';
  23.  
  24. function checkButton() {
  25. var button = document.getElementById(btn_id);
  26. if (button == null) {
  27. addButton();
  28. }
  29. }
  30.  
  31. function addButton() {
  32. var cont = document.getElementById('watch7-user-header');
  33. var btn = document.createElement('button');
  34. lastContainerChild = cont.lastElementChild;
  35. btn.id = 'stop-download';
  36. btn.setAttribute('type', 'button');
  37. btn.setAttribute('title', 'Stop Youtube Download');
  38. btn.setAttribute('data-tooltip', 'Stop Youtube Download');
  39. btn.setAttribute('data-tooltip-title', 'Stop Youtube Download');
  40. btn.setAttribute('class', 'yt-subscription-button yt-uix-button yt-uix-button-subscribe-branded');
  41. btn.style.marginLeft = '10px';
  42. var txt = document.createElement('span');
  43. txt.setAttribute('id','stpdownload');
  44. txt.appendChild(document.createTextNode('Stop Video'));
  45. txt.setAttribute('class', 'yt-uix-button-content');
  46. btn.appendChild(txt);
  47. cont.appendChild(btn);
  48. btn.addEventListener('click',stopvidload, true);
  49. }
  50.  
  51.  
  52. function stopvidload(){
  53. var p;
  54. document.getElementById("movie_player-flash") ? p = document.getElementById("movie_player-flash") : null;
  55. document.getElementById("movie_player") ? p = document.getElementById("movie_player") : null;
  56. p.stopVideo();
  57.  
  58. }
  59. window.setInterval(checkButton, 1000);