TVer - 長いタイトルをホバーでフル表示

TVerの番組名やエピソードタイトルが省略されて表示されるとき、マウスオーバーで全文を表示します。

// ==UserScript==
// @name         TVer - 長いタイトルをホバーでフル表示
// @name:en      TVer - Show full title on hover
// @namespace    https://tver.jp/
// @version      1.0
// @description  TVerの番組名やエピソードタイトルが省略されて表示されるとき、マウスオーバーで全文を表示します。
// @description:en  Show the full text of truncated TVer titles when hovering the mouse.
// @author       あなたの名前
// @match        https://tver.jp/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 動的に追加される要素にも対応
    const observer = new MutationObserver(() => {
        document.querySelectorAll('div, span, a').forEach(el => {
            const style = window.getComputedStyle(el);
            if (style.textOverflow === 'ellipsis' && style.overflow === 'hidden') {
                if (!el.title && el.textContent.trim()) {
                    el.title = el.textContent.trim();
                }
            }
        });
    });

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