Greasy Fork is available in English.

YoutubeClock figuccio

aggiunge clock sui video youtube

// ==UserScript==
// @name         YoutubeClock figuccio
// @namespace    https://greasyfork.org/users/237458
// @version      1
// @description  aggiunge clock sui video youtube
// @author       figuccio
// @match        https://www.youtube.com/watch?v=*
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';
    GM_addStyle('.ytp-time-display {color:red!important;background:blue!important;border-radius:10px!important}');
    let bar = document.getElementsByClassName("ytp-right-controls")[0];
    let clock = document.createElement("span");
    clock.classList.add("ytp-time-display");
    clock.innerText = "Toto";

    function clockTime() {
        var today = new Date();
        var h = today.getHours();
        var m = today.getMinutes();
        var s = today.getSeconds();
        var milli = today.getMilliseconds()
        if (h < 10) h = "0" + h;
        if (m < 10) m = "0" + m;
        if (s < 10) s = "0" + s;
        clock.innerText = h + ":" + m + ":" + s+ ":" +milli;;
        setTimeout(clockTime, 70);
    }
    clockTime();
    bar.insertBefore(clock, bar.childNodes[0]);
})();