Greasy Fork

Greasy Fork is available in English.

YouTube Web Tweaks Lite

This script is based on YouTube Web Tweaks (except with only the removal of video paused continue watching popup and it keeps the shorts player)

当前为 2023-09-27 提交的版本,查看 最新版本

// ==UserScript==
// @name         YouTube Web Tweaks Lite
// @version      1.3.5
// @description  This script is based on YouTube Web Tweaks (except with only the removal of video paused continue watching popup and it keeps the 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
// @inject-into  page
// @allFrames    true
// @grant        none
// ==/UserScript==
 
// Modifiying yt.config flags
(function() {
    window['yt'] = window['yt'] || {};
    yt['config_'] = yt.config_ || {};
    yt.config_['EXPERIMENT_FLAGS'] = yt.config_.EXPERIMENT_FLAGS || {};
 
    var iv = setInterval(function() {
        yt.config_.IS_TABLET = true;
        yt.config_.DISABLE_YT_IMG_DELAY_LOADING = true;
        yt.config_.EXPERIMENT_FLAGS.polymer_verifiy_app_state = false;
        yt.config_.EXPERIMENT_FLAGS.desktop_delay_player_resizing = false;
        yt.config_.EXPERIMENT_FLAGS.web_animated_actions = false;
        yt.config_.EXPERIMENT_FLAGS.web_animated_like = false;
        yt.config_.EXPERIMENT_FLAGS.web_animated_like_lazy_load = false;
        yt.config_.EXPERIMENT_FLAGS.render_unicode_emojis_as_small_images = true;
        yt.config_.EXPERIMENT_FLAGS.kevlar_refresh_on_theme_change = false;
        yt.config_.EXPERIMENT_FLAGS.kevlar_watch_cinematics = false;
        yt.config_.EXPERIMENT_FLAGS.kevlar_watch_grid = false;
        yt.config_.EXPERIMENT_FLAGS.kevlar_watch_grid_hide_chips = false;
        yt.config_.EXPERIMENT_FLAGS.kevlar_watch_metadata_refresh_no_old_secondary_data = false;
        yt.config_.EXPERIMENT_FLAGS.kevlar_watch_comments_panel_button = false;
    }, 1);
 
    var to = setTimeout(function() {
        clearInterval(iv);
    }, 1000)
})();
 
// CSS tweaks to be applied (including removal of "Video paused. Continue watching?" popup)
(function() {
ApplyCSS();

function ApplyCSS() {
var styles = document.createElement("style");
styles.innerHTML=`
/* Hide Shorts on related videos (including remixes) */
ytd-reel-shelf-renderer.style-scope.ytd-item-section-renderer {
  display: none !important;
}

ytd-reel-shelf-renderer.ytd-structured-description-content-renderer {
  display: none !important;
}

/* Remove ambient light on watch page */
cinematics.ytd-watch-flexy {
display: none !important;
}`
document.head.appendChild(styles);
}
})();

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);