YouTube Web Tweaks

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

当前为 2022-07-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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://greasyfork.org/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);
})();