YouTube Shorts Auto-Advance

Automatically advances to the next video short when the current one ends (optional fullscreen mode)

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         YouTube Shorts Auto-Advance
// @namespace    https://greasyfork.org/en/users/10118-drhouse
// @version      2.1
// @description  Automatically advances to the next video short when the current one ends (optional fullscreen mode)
// @include      https://www.youtube.com/shorts/*
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// @require      https://greasyfork.org/scripts/439099-monkeyconfig-modern-reloaded/code/MonkeyConfig%20Modern%20Reloaded.js?version=1012538
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @author       drhouse
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_deleteValue
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @grant        GM_notification
// @license      CC-BY-NC-SA-4.0
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);

(function($){

    (window.addEventListener("yt-navigate-finish", function(event) {

        var cfg = new MonkeyConfig({
            title: 'Configure',
            menuCommand: true,
            params: {
                'Automatic Fullscreen': {
                    type: 'checkbox',
                    default: false
                },
            },
        })

        function openFullscreen(elem) {
            if (elem.requestFullscreen) {
                elem.requestFullscreen();
            } else if (elem.mozRequestFullScreen) { /* Firefox */
                elem.mozRequestFullScreen();
            } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
                elem.webkitRequestFullscreen();
            } else if (elem.msRequestFullscreen) { /* IE / Edge */
                elem.msRequestFullscreen();
            }
        }

        setTimeout(function(){
            if (cfg.get('Automatic Fullscreen')) {
                // var elem = $('.html5-main-video').get(0);
                var elem = $('.html5-main-video').parent().parent().parent().parent().parent().parent().parent().parent().get(0);
                openFullscreen(elem);
            }
            $(".html5-main-video").removeAttr("loop");
            $(".html5-main-video").on('ended',function(){
                $('#navigation-button-down > ytd-button-renderer:nth-child(1)').get(0).click()
            });
        }, 1000);

    }))
})(jQuery);