Greasy Fork

Greasy Fork is available in English.

YouTube Web Tweaks lite edition

This is the version of YouTube Web Tweaks but without patch collection integrated into it. Also includes VP9/AV1 disabler script that optimizes video playback on very-low end computers.

当前为 2025-09-11 提交的版本,查看 最新版本

// ==UserScript==
// @name         YouTube Web Tweaks lite edition
// @version      1.7.0
// @description  This is the version of YouTube Web Tweaks but without patch collection integrated into it. Also includes VP9/AV1 disabler script that optimizes video playback on very-low end computers.
// @author       Magma_Craft
// @license MIT
// @match        *://www.youtube.com/*
// @match        *://www.youtube-nocookie.com/*
// @match        *://www.youtu.be/*
// @namespace    http://greasyfork.icu/en/users/933798
// @icon         https://www.youtube.com/favicon.ico
// @unwrap
// @run-at       document-start
// @unwrap
// @grant        none
// ==/UserScript==

(function() {
let css = `
/* Remove minimal annoyances */
ytd-ad-slot-renderer, div#sparkles-container.style-scope.ytd-promoted-sparkles-web-renderer, ytm-promoted-sparkles-web-renderer, ytd-video-quality-promo-renderer, ytd-merch-shelf-renderer, ytd-enforcement-message-view-model, div[is-shared-heimdall], tp-yt-iron-overlay-backdrop.opened, ytd-promoted-sparkles-web-renderer, ytd-text-image-no-button-layout-renderer {
display: none !important
}

ytd-watch-metadata.ytd-watch-flexy {
padding-bottom: 36px !important;
}

/* Remove every unwanted compact renderer in related section and limit the number of yt-lockup-view-model to 9 */
#related ytd-compact-video-renderer, ytd-compact-movie-renderer, #related ytd-compact-playlist-renderer, #related ytd-compact-radio-renderer, #related yt-lockup-view-model, #related ytd-channel-renderer, ytd-watch-flexy ytd-reel-shelf-renderer, ytd-watch-flexy ytd-rich-section-renderer, #related ytd-continuation-item-renderer, #related #continuations {
display: none !important
}

#related yt-lockup-view-model:nth-of-type(1), #related yt-lockup-view-model:nth-of-type(2), #related yt-lockup-view-model:nth-of-type(3), #related yt-lockup-view-model:nth-of-type(4), #related yt-lockup-view-model:nth-of-type(5), #related yt-lockup-view-model:nth-of-type(6), #secondary #related yt-lockup-view-model:nth-of-type(7), #secondary #related yt-lockup-view-model:nth-of-type(8), #secondary #related yt-lockup-view-model:nth-of-type(9) {
display: flex !important
}`;
if (typeof GM_addStyle !== "undefined") {
  GM_addStyle(css);
} else {
  let styleNode = document.createElement("style");
  styleNode.appendChild(document.createTextNode(css));
  (document.querySelector("head") || document.documentElement).appendChild(styleNode);
}
})();

// Force disabling WebGL to fix video playback issues
//
// What is this userscript trying to address?
// When playing a video, only a small part of the video loads, and the subsequent
// parts do not load afterward.

(function () {
  "use strict";

  const originalGetContext = HTMLCanvasElement.prototype.getContext;
  HTMLCanvasElement.prototype.getContext = function (contextType) {
    if (contextType === "webgl" || contextType === "webgl2") {
      console.log("WebGL is disabled by Tampermonkey");
      return null;
    }
    return originalGetContext.apply(this, arguments);
  };
})();