Stop YouTube Shorts Auto Loop

Menghentikan video Shorts agar tidak mengulang otomatis setelah selesai

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

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 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         Stop YouTube Shorts Auto Loop
// @namespace    Stop-YouTube-Shorts-Auto-Loop
// @version      1.0
// @name:id      Hentikan Auto-Loop YouTube Shorts
// @name:en      Stop YouTube Shorts Auto-Loop
// @description  Menghentikan video Shorts agar tidak mengulang otomatis setelah selesai
// @description:id  Menghentikan video Shorts agar tidak mengulang otomatis setelah selesai
// @description:en  Prevent YouTube Shorts from looping automatically when video ends
// @author       3xploiton3
// @match        *://www.youtube.com/shorts/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const observer = new MutationObserver(() => {
        const video = document.querySelector('video');
        if (video) {
            video.loop = false;

            // Remove event listeners YouTube might be adding
            video.addEventListener('ended', () => {
                console.log('Video ended – loop is disabled');
                // Optional: Pause to ensure no restart
                video.pause();
            });
        }
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();