Greasy Fork is available in English.

ytConfigHacks

To provide a way to hack the yt.config_ such as EXPERIMENT_FLAGS

Version au 13/04/2024. Voir la dernière version.

Ce script ne doit pas être installé directement. C'est une librairie destinée à être incluse dans d'autres scripts avec la méta-directive // @require https://update.greasyfork.org/scripts/475632/1359674/ytConfigHacks.js

Auteur
𝖢𝖸 𝖥𝗎𝗇𝗀
Version
0.4.2
Créé
19/09/2023
Mis à jour
13/04/2024
Taille
5,74 ko
Licence
MIT

The script must be included from a userscript with the following metablocks

  • // @match https://www.youtube.com/*
  • // @run-at document-start
  • // @inject-into page
  • // @grant none

Then an array window._ytConfigHacks will be provided and push your function into the array.

Testing

// ==UserScript==// @name        New1235// @namespace   Violentmonkey Scripts// @match       https://gfork.dahi.icu/*// @grant       none// @version     1.0// @author      -// @description 9/19/2023, 10:41:12 AM// @require https://update.greasyfork.org/scripts/475632/1359659/ytConfigHacks.js// ==/UserScript==console.log(window._ytConfigHacks)window._ytConfigHacks.add(function(){console.log('test OK')});window.ytcsi={tick:function(){}}window.yt={}window.yt.config_={};ytcsi.tick;

Real Example

// ==UserScript==// @name        YouTube: Force Animated-Rolling-Number for Live// @namespace   Violentmonkey Scripts// @match       https://www.youtube.com/*// @grant       none// @version     1.0// @author      -// @description 9/19/2023, 9:32:49 AM// @run-at      document-start// @inject-into page// @unwrap// @require https://update.greasyfork.org/scripts/475632/1359659/ytConfigHacks.js// ==/UserScript==(() => {let mex = 0;window._ytConfigHacks.add((config_) => {let EXPERIMENT_FLAGS = null;EXPERIMENT_FLAGS = config_.EXPERIMENT_FLAGS || 0;if (EXPERIMENT_FLAGS) {if (!mex) {mex = 1;console.log('EXPERIMENT_FLAGS detected')}EXPERIMENT_FLAGS.web_enable_dynamic_metadata = true;EXPERIMENT_FLAGS.dynamic_metadata_update_interaction_delay_period_sec = 8;}});})();

Scripts Using this Library