Greasy Fork is available in English.

Double Stop YouTube Video with Delay

Apply double stop to YouTube video on refresh with delay

// ==UserScript==
// @name         Double Stop YouTube Video with Delay
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Apply double stop to YouTube video on refresh with delay
// @author       AFKHAISE
// @match        https://www.youtube.com/*
// @grant        none
// @license MIT
// ==/UserScript==


(function() {
    'use strict';

    function doublePauseWithDelay() {
        setTimeout(() => {
            let videos = document.querySelectorAll('video');
            videos.forEach(video => {
                if (!video.paused) {
                    video.pause();
                    setTimeout(() => {
                        if (!video.paused) {
                            video.pause();
                        }
                    }, 1000);
                }
            });
        }, 3000);
    }

    window.addEventListener('load', doublePauseWithDelay);
})();