YouTube Live show timer

11/11/2024, 9:55:55 PM

// ==UserScript==
// @name        YouTube Live show timer
// @namespace   Violentmonkey Scripts
//
// Just match all of them, should be fine, applies on any site :)
// @match       https://www.youtube.com/live/*
// @match       https://www.youtube.com/watch?v=*
// @match       https://www.youtube.com/embed/*
//
// @grant       none
// @version     1.0.2
// @author      mif
// @license     MIT
// @description 11/11/2024, 9:55:55 PM
// ==/UserScript==

function GM_addStyle (cssStr) {
    var D               = document;
    var newNode         = D.createElement ('style');
    newNode.textContent = cssStr;

    var targ    = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
    targ.appendChild (newNode);
}


// original line
GM_addStyle('#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > div.ytp-time-display.notranslate.ytp-live > span.ytp-time-wrapper > span.ytp-time-current { display: contents!important; }');
// As of 2025-05-09
GM_addStyle('#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > div.ytp-time-display.notranslate.ytp-live > span.ytp-time-wrapper > div > span.ytp-time-current { display: contents!important; }');
// --- Fix for missing "Skip ahead to live broadcast."
GM_addStyle('.ytp-time-display { display: contents; line-height: unset; }');