YouTube Title Fixer

Fixes a severely broken UI flaw in YouTube by removing the annoying and unnecessary "(X)" from page titles. Seriously, I have 15 tabs in a row showing "(1) ...", obscuring the actual page titles. This is just stupid.

目前為 2017-09-14 提交的版本,檢視 最新版本

// ==UserScript==
// @name         YouTube Title Fixer
// @description  Fixes a severely broken UI flaw in YouTube by removing the annoying and unnecessary "(X)" from page titles. Seriously, I have 15 tabs in a row showing "(1) ...", obscuring the actual page titles. This is just stupid.
// @author       Braden Best
// @namespace    bradenscode.nogit
// @version      1.0.0
// @match        *://*.youtube.com/*
// ==/UserScript==

/*
 * = API =
 * `youtube_title_fixer` is an object containing the following functions:
 *
 *   kill  kill the loop
 *   init  manually start the loop
 *
 * You can use this interface to terminate and restart the loop for whatever reason.
 */

const youtube_title_fixer = (function(){
    let loop;

    function fixit(){
        let pattern = /\(\d+\)\s+/;

        if(document.title.match(pattern) !== null)
            document.title = document.title.replace(pattern, "");
    }

    function kill(){
        clearInterval(loop);
    }

    function init(){
        loop = setInterval(fixit, 1000);
    }

    init();

    return {
        kill,
        init
    };
}());

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址