您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This userscript will force all videos to use the h.264 codec rather than VP9/AV1.
// ==UserScript== // @name Block AV1 & VP9 // @version 1.0 // @description This userscript will force all videos to use the h.264 codec rather than VP9/AV1. // @author TZ Shuhag // @license MIT // @match *://www.youtube-nocookie.com/* // @match *://www.youtube.com/* // @match *://m.youtube.com/* // @namespace https://greasyfork.org/en/users/1495563 // @icon https://raw.githubusercontent.com/tz-shuhag/HD.264/refs/heads/main/icons/video.png // @run-at document-idle // @unwrap // @grant none // ==/UserScript== // Enable strict mode to catch common coding mistakes "use strict"; // Force all videos to use h.264 (useful if you have a low spec machine when you load videos in 720p60) var mse = window.MediaSource; if (mse){ // Set up replacement for MediaSource type support function var nativeITS = mse.isTypeSupported.bind(mse); mse.isTypeSupported = ourITS(nativeITS); } // Here's the replacement function ourITS(fallback){ // type is a string (hopefully!) sent by the page return function (type) { if (type === undefined) return ''; // We only reject VP9 if (type.toLowerCase().indexOf('vp9') > -1) return ''; if (type.toLowerCase().indexOf('vp09') > -1) return ''; // Added 12/20/2019 // Let Firefox handle everything else return fallback(type); }; }