Stop YouTube Video Download

Stops YouTube Video From Downloading.

当前为 2014-09-27 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Stop YouTube Video Download
// @namespace   http://userscripts.org/users/sknepal
// @description Stops YouTube Video From Downloading.
// @include        http://*.youtube.com/*
// @include        http://youtube.com/*
// @include        https://*.youtube.com/*
// @include        https://youtube.com/*
// @grant       none
// @version     1.3
// ==/UserScript==

/* CHANGE LOG
1.3 (9/27/2014)  : removed return statement that was causing the error.
1.2 (1/27/2014)  : made it support Youtube 'red bar' feature (SPF).
                   thanks to JoeSimmons for the idea : http://userscripts.org/scripts/show/174846
1.1 (08/18/2013) : removed pauseVideo option.
1.0 (07/21/2013) : created.

*/

var btn_id = 'stop-download';

function checkButton() {
    var button = document.getElementById(btn_id);
    if (button == null) {
        addButton();
    }
}

function addButton() {
    var cont = document.getElementById('watch7-user-header');
    var btn = document.createElement('button');
    lastContainerChild = cont.lastElementChild;
    btn.id = 'stop-download';
    btn.setAttribute('type', 'button');
    btn.setAttribute('title', 'Stop Youtube Download');
    btn.setAttribute('data-tooltip', 'Stop Youtube Download');
    btn.setAttribute('data-tooltip-title', 'Stop Youtube Download');
    btn.setAttribute('class', 'yt-subscription-button yt-uix-button yt-uix-button-subscribe-branded');
    btn.style.marginLeft = '10px';
    var txt = document.createElement('span');
    txt.setAttribute('id','stpdownload');      
    txt.appendChild(document.createTextNode('Stop Video'));
    txt.setAttribute('class', 'yt-uix-button-content');
    btn.appendChild(txt);
    cont.appendChild(btn);
    btn.addEventListener('click',stopvidload, true);
}


function stopvidload(){
    var p;
    document.getElementById("movie_player-flash") ? p = document.getElementById("movie_player-flash") : null;
    document.getElementById("movie_player") ? p = document.getElementById("movie_player") : null;
    p.stopVideo();

}
    window.setInterval(checkButton, 1000);