Greasy Fork is available in English.
This script is based on YouTube Web Tweaks (except it keeps most stuff including shorts player)
当前为
// ==UserScript==
// @name YouTube Web Tweaks Lite
// @version 1.5.1
// @description This script is based on YouTube Web Tweaks (except it keeps most stuff including shorts player)
// @author Magma_Craft
// @license MIT
// @match *://www.youtube.com/*
// @namespace http://greasyfork.icu/en/users/933798
// @icon https://www.youtube.com/favicon.ico
// @unwrap
// @run-at document-start
// @unwrap
// @grant none
// ==/UserScript==
// Enable strict mode to catch common coding mistakes
"use strict";
// Define the flags to assign to the EXPERIMENT_FLAGS object
const flagsToAssign = {
IS_TABLET: true,
DISABLE_YT_IMG_DELAY_LOADING: true,
polymer_verifiy_app_state: false,
desktop_delay_player_resizing: false,
web_animated_actions: false,
web_animated_like: false,
web_animated_like_lazy_load: false,
render_unicode_emojis_as_small_images: true,
smartimation_background: false,
kevlar_refresh_on_theme_change: false,
kevlar_watch_cinematics: false
};
const updateFlags = () => {
// Check if the EXPERIMENT_FLAGS object exists in the window.yt.config_ property chain
const expFlags = window?.yt?.config_?.EXPERIMENT_FLAGS;
// If EXPERIMENT_FLAGS is not found, exit the function
if (!expFlags) return;
// Assign the defined flags to the EXPERIMENT_FLAGS object
Object.assign(expFlags, flagsToAssign);
};
// Create a MutationObserver that calls the updateFlags function when changes occur in the document's subtree
const mutationObserver = new MutationObserver(updateFlags);
mutationObserver.observe(document, { subtree: true, childList: true });
Object.defineProperties(document, { /*'hidden': {value: false},*/ 'webkitHidden': {value: false}, 'visibilityState': {value: 'visible'}, 'webkitVisibilityState': {value: 'visible'} });
setInterval(function(){
document.dispatchEvent( new KeyboardEvent( 'keyup', { bubbles: true, cancelable: true, keyCode: 143, which: 143 } ) );
}, 60000);