// ==UserScript== // @name YouTube Web Tweaks Lite // @version 1.5.3 // @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 https://greasyfork.org/en/users/933798 // @icon https://www.youtube.com/favicon.ico // @unwrap // @run-at document-start // @unwrap // @grant none // @downloadURL none // ==/UserScript== // Enable strict mode to catch common coding mistakes "use strict"; // Define the flags to assign to the EXPERIMENT_FLAGS object const flagsToAssign = { desktop_delay_player_resizing: false, web_animated_actions: false, web_animated_like: false, web_animated_like_lazy_load: false, 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 }); (function() { let css = ` /* Remove filter categories on search results and playlists to make the UI less usable on low-entry machines */ ytd-item-section-renderer.style-scope.ytd-section-list-renderer[page-subtype="playlist"] > #header.ytd-item-section-renderer > ytd-feed-filter-chip-bar-renderer { display: none !important; } div#chip-bar.style-scope.ytd-search-header-renderer > yt-chip-cloud-renderer.style-scope.ytd-search-header-renderer > div#container.style-scope.yt-chip-cloud-renderer { display: none !important; } /* Remove all annoyances (except for 'YT TV and Premium' banners) */ ytd-action-companion-ad-renderer, ytd-display-ad-renderer, ytd-video-masthead-ad-advertiser-info-renderer, ytd-video-masthead-ad-primary-video-renderer, ytd-in-feed-ad-layout-renderer, ytd-ad-slot-renderer, yt-about-this-ad-renderer, yt-mealbar-promo-renderer, ytd-ad-slot-renderer, ytd-in-feed-ad-layout-renderer, .ytd-video-masthead-ad-v3-renderer, div#root.style-scope.ytd-display-ad-renderer.yt-simple-endpoint, div#sparkles-container.style-scope.ytd-promoted-sparkles-web-renderer, div#main-container.style-scope.ytd-promoted-video-renderer, div#player-ads.style-scope.ytd-watch-flexy, ad-slot-renderer, ytm-promoted-sparkles-web-renderer, masthead-ad, tp-yt-iron-overlay-backdrop, #masthead-ad, ytd-engagement-panel-section-list-renderer, ytd-video-quality-promo-renderer { display: none !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); } })(); 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);