YouTube Live show timer

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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.4
// @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; }');

// As of 2025-11-24 - why is there an additional div now? idk
GM_addStyle('#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > div.ytp-time-display.notranslate.ytp-live > div > div { display: contents!important; }');
GM_addStyle('#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > div.ytp-time-display.notranslate.ytp-live > div > div > span.ytp-time-current { display: contents!important; }');
// GM_addStyle('#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > div.ytp-time-display.notranslate.ytp-live > div > div > span.ytp-time-separator { display: none; }');
GM_addStyle('#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > div.ytp-time-display.notranslate.ytp-live > div > div > span.ytp-time-duration { display: none; }');

// --- Fix for missing "Skip ahead to live broadcast."
GM_addStyle('.ytp-time-display { display: contents; line-height: unset; }');
// As of 2025-09-17 - Restore Next video button (I LOVE A/B TESTS)
GM_addStyle('#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > a.ytp-next-button.ytp-button.ytp-playlist-ui { display: unset!important;}');