TMDB - Disable Video Thumbnails & Hover Preview

Completely disables TMDB video poster previews (hover autoplay)

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         TMDB - Disable Video Thumbnails & Hover Preview
// @namespace    https://greasyfork.org/users/yourname
// @version      1.2
// @description  Completely disables TMDB video poster previews (hover autoplay)
// @author       Grok
// @match        https://www.themoviedb.org/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Method 1: Replace video posters with their static fallback image
    const observer = new MutationObserver(() => {
        document.querySelectorAll('.video[data-src]').forEach(video => {
            if (video.parentElement && video.parentElement.dataset.poster) {
                const posterUrl = video.parentElement.dataset.poster;
                const img = document.createElement('img');
                img.src = posterUrl;
                img.style.cssText = 'width:100%; height:100%; object-fit:cover;';
                img.className = video.className;
                video.parentElement.replaceChild(img, video);
            }
        });

        // Also kill any remaining <video> elements in posters
        document.querySelectorAll('div.card video').forEach(v => {
            v.pause();
            v.removeAttribute('src');
            v.load();
            v.remove();
        });
    });

    observer.observe(document.body, { childList: true, subtree: true });

    // Immediate cleanup on page load
    document.querySelectorAll('video').forEach(v => {
        if (v.closest('.card') || v.closest('.image')) {
            v.pause();
            v.src = '';
            v.remove();
        }
    });

    // Optional: inject CSS to be extra sure
    const style = document.createElement('style');
    style.textContent = `
        video { display: none !important; }
        .card img, .image img { display: block !important; }
        .no_image video { display: none !important; }
    `;
    document.head.appendChild(style);
})();