YouTube Hide Sidebar Preview

Hides the GIF preview that happens when you hover videos in the sidebar.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name                YouTube Hide Sidebar Preview
// @icon                https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @author              ElectroKnight22
// @namespace           electroknight22_youtube_hide_sidebar_preview_namespace
// @version             0.0.2
// @match               *://www.youtube.com/*
// @noframes
// @grant               GM.addStyle
// @run-at              document-start
// @license             MIT
// @description         Hides the GIF preview that happens when you hover videos in the sidebar.
// ==/UserScript==

/*jshint esversion: 11 */

(function () {
    'use strict';
    const hidePreviewCss = `
        ytd-moving-thumbnail-renderer {
            display: none !important;
        }
    `

    if (typeof GM !== 'undefined' && typeof GM.addStyle === 'function') {
        GM.addStyle(hidePreviewCss);
    } else {
        // Fallback for older script managers or if the function is not available.
        const styleNode = document.createElement('style');
        styleNode.textContent = hidePreviewCss;
        document.head.appendChild(styleNode);
    }
})();