取消youtube自动播放下一个视频

自动取消所有Youtube视频结尾的自动播放,拒绝YT推流.

// ==UserScript==
// @name               取消youtube自动播放下一个视频
// @name               No more youtube nextVideo!
// @icon               data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCABkAGQDAREAAhEBAxEB/8QAHgAAAgICAwEBAAAAAAAAAAAAAAkGBwgKAwQFCwL/xABCEAABBQABAwMDAQMGCgsAAAAEAQIDBQYHAAgRCRITFBUhMQoWGBdBUXGR1RkiJVVWYYGVpdYjJjJSZWd2obG18f/EAB0BAAIDAQADAQAAAAAAAAAAAAAHBQYIBAIDCQH/xABJEQACAgECBQIDBAQJBw0AAAABAgMEBQYRAAcSEyEUMRUiQQgWMlEjcdPUFyQzQlJTYaOkGDRUVZGSkyViY2VmcoGEoabB5OX/2gAMAwEAAhEDEQA/AMuOnRx8v+Do4ODo4ODo4OMwOxnigflzuDztYapjK3JgkbuxmDfYiuHHoT6yCIj7vQ7vA6jPGQnWQj6DQ5g29sajUJRlH5izzjbyUOHzts08dI69PVKwgUN0ncyK5I6JK9iKRSqt3I5VjV4u4FlWTthmXyl06mpNZ0q8vdEGOifLzNEZ4yiVJq6K/qaeXw+QpSrNPEad2hLbnrZD0kk1CxRFtolnftBPqthcNcr8c+mr2yySC4rhWGpueaTrUw/TSpryFAuePuN6PT6ayubwULj6kIeddRuJcGJLeZ3MgOgr8wRXRqfK5KeIyWHk7cthJGeZESMliAC3TGqIpcgs7dILtux3ZmY7207p6jSpVMVTimXH0lSvUgltW7rxRKxMcQsXLE9looQRHBG8rJBAkcEKpBFHGmSPYf3tcu5bgvDRM39xlZ5oD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YoY+vTmMTMrNGZa9RJDGzIjMnV0kopIJA25s19obKahpihm85rXMUhKk61cpkpshWE6K6JMILeWliEyJJIqydHWqyOAwDEHJ4Xum45GgZC2m2nhjUan+TqP9ET/1H1OfB7P9OD/ek/ZcUs8x8IST6XK+f+gqfv3HY/iu47/zNtP93Uf/ADH0fB7P9OD/AHpP2XB/CNhP9Fyv/Aqfv3C++rHwluDo4ODo4ODo4ODo4ODo4ODo4ODo4ODo4ODo4ODo4ODo4ODo4OP/2Q==
// @namespace          CherryChen
// @version            0.0.10
// @description        自动取消所有Youtube视频结尾的自动播放,拒绝YT推流.
// @description        Automatically cancel all youtube video endscreen playnext!
// @author             CherryChen
// @license            GPL-3.0 License
// jshint              esversion:6
// @match              *://www.youtube.com/*
// ==/UserScript==

(function() {
    'use strict';
    var cancelInt=0;
    var timeout=2000;
    var nowmax;
    var debug=false;
    var level2=false;
    var level3=false;

    var log=function(msg, level=debug){
        if(debug){
            if(level){
                window.console.log (msg);
            }
        }
    };
    var undisplaymenu=function(){
        //context menu panel
        var contextmenu=document.querySelector(".ytp-popup.ytp-contextmenu");
        //setting menu panel
        var settingmenu=document.querySelector(".ytp-popup.ytp-settings-menu");
        log('- setting:'+settingmenu+'_context:'+contextmenu, level2);
        //undisplay settingmenu and contextmenu
        if(contextmenu){
            //context menu panel
            var contextmenu_style=document.querySelector(".ytp-contextmenu").style.display;
            if(contextmenu_style==''){contextmenu_style='none';}else{log('no settingmenu',level3);}
        }else{log('- contextmenu is null.', level2);}
        if(settingmenu){
            //setting menu panel
            var settingmenu_style=document.querySelector(".ytp-settings-menu").style.display;
            if(settingmenu_style==''){settingmenu_style='none';}else{log('no contextmenu',level3);}
        }else{log('- settingmenu is null.', level2);}
    };
    var gettimeout=function(){
        //video
        var video=document.querySelector("video");
        var current=video.currentTime;
        var duration=video.duration;
        var diff=duration-current;
        log('- duration:'+duration+'_current:'+current+'_diff:'+diff, level2);
        //switch
        if(diff>10){
            log('- timeout=5000',level3);
            timeout=5000;
        }else if(diff>5){
            log('- timeout=3000',level3);
            timeout=3000;
            undisplaymenu()
        }else if(diff>2){
            log('- timeout=1000',level3);
            timeout=1000;
            undisplaymenu()
        }else if(diff>0){
            log('- timeout=400',level3);
            timeout=400;
        }else{
            log('- timeout=5000',level3);
            timeout=5000;
        }
        var durations=duration.toString().split('.')[0];
        var currents=current.toString().split('.')[0];
        nowmax=currents+'-'+durations+'_'+(durations-currents)+'-'+timeout;
        return timeout;
    };
    var cancelUpnext=function(){
        //permanent element:
        //<button class="ytp-autonav-endscreen-upnext-button ytp-autonav-endscreen-upnext-cancel-button" aria-label="取消自动播放">取消</button>
        //<a class="ytp-autonav-endscreen-upnext-button ytp-autonav-endscreen-upnext-play-button" role="button" aria-label="播放下一个视频">立即播放</a>
        //<button class="ytp-button ytp-mdx-privacy-popup-cancel">取消</button>
        //<button class="ytp-button ytp-mdx-privacy-popup-confirm">确认</button>

        //endscreen suggest set header(including countdown)
		var countdown=document.querySelector(".ytp-autonav-endscreen-upnext-header-countdown-number");
        //endscreen suggest set cancel button
        var upnextbtn=document.querySelector(".ytp-autonav-endscreen-upnext-cancel-button");
        //Determine whether the element is displayed
        log('- cancelBtn_noNum:'+upnextbtn, level2);
        if(upnextbtn){
            log('- countdown_num:'+countdown, level2);
            if(countdown!=null){
                upnextbtn=document.querySelector(".ytp-autonav-endscreen-upnext-cancel-button");
                log('- cancelBtn_withNum:'+upnextbtn, level3);
                log("Clicking cancelBtn now..."+new Date().toLocaleTimeString().substring(2));
                upnextbtn.click();
                if(cancelInt){clearTimeout(cancelInt);}else{log('exception1:'+cancelInt, level3);}
                cancelInt=setTimeout(cancelUpnext,5000);
            }else{
                log("Checking cancelBtn now..."+cancelInt+"..."+new Date().toLocaleTimeString().substring(2)+"..."+nowmax);
                if(cancelInt){clearTimeout(cancelInt);}else{log('exception2:'+cancelInt, level3);}
                cancelInt=setTimeout(cancelUpnext,gettimeout());
                log('- gettimeout: runed.', level2);
            }
        }else{
            log("Null upnextbtn.", level2);
            if(cancelInt) {clearTimeout(cancelInt);}else{log('exception3:'+cancelInt, level3);}
            cancelInt=setTimeout(cancelUpnext,5000);
        }
        log('---------------end of cancelUpnext_'+(cancelInt-1)+'----------------');
    };
    cancelUpnext();

})();