YouTube Web Tweaks

It speeds up YouTube by 50% by modified configs, removed Shorts button and others.

目前為 2022-07-13 提交的版本,檢視 最新版本

// ==UserScript==
// @license      MIT
// @name         YouTube Web Tweaks
// @version      1.0.0
// @description  It speeds up YouTube by 50% by modified configs, removed Shorts button and others.
// @author       Magma_Craft
// @match        https://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?domain=youtube.com
// @run-at       document-start
// @namespace    https://gf.qytechs.cn/en/users/933798
// ==/UserScript==

// yt config edits

(function() {
    window['yt'] = window['yt'] || {};
    yt['config_'] = yt.config_ || {};
    yt.config_['EXPERIMENT_FLAGS'] = yt.config_.EXPERIMENT_FLAGS || {};

    var iv = setInterval(function() {
        //probably for m.youtube.com
        yt.config_.IS_TABLET = true;
        //dk what is this
        yt.config_.EXPERIMENT_FLAGS.polymer_verifiy_app_state = false;
        //disables the "warm loading" thingy, ie the red bar when loading, letting the page load completely fresh every single time
        //yt.config_.DISABLE_WARM_LOADS = true;
        //yt.config_.EXPERIMENT_FLAGS.warm_load_nav_start_web = false;
        yt.config_.EXPERIMENT_FLAGS.kevlar_player_response_swf_config_wrapper_killswitch = false;
        //yt.config_.WEB_PLAYER_CONTEXT_CONFIGS.WEB_PLAYER_CONTEXT_CONFIG_ID_KEVLAR_WATCH.playerStyle = "blazer";
        yt.config_.EXPERIMENT_FLAGS.desktop_player_touch_gestures = false;
        //loads images faster damnit
        yt.config_.DISABLE_YT_IMG_DELAY_LOADING = true;

    }, 1);

    var to = setTimeout(function() {
        clearInterval(iv);
    }, 1000)
})();

// remove shorts button

window.setTimeout(
    function check() {
        if (document.querySelector('[title="Shorts"]')) {
            shorts();
        }
        window.setTimeout(check, 250);
    }, 250
);

function shorts() {
    var node = document.querySelector('[title="Shorts"]');
    node.style.display = "none";
}

// remove the "Video paused. Continue watching?" popup

var interval = setInterval(function() {
    window.wrappedJSObject._lact = Date.now();
}, 300000);

// remove Download button on watch

(function() {
    'use strict';
    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerText = 'ytd-menu-service-item-download-renderer{display:none;}';
    document.head.appendChild(style);
})();
(function() {
    'use strict';
    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerText = 'ytd-download-button-renderer{display:none;}';
    document.head.appendChild(style);
})();

QingJ © 2025

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