Jable修改页面

该脚本修改Jable页面,使视频标题不再被隐藏,完整显示。

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Jable修改页面
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description        该脚本修改Jable页面,使视频标题不再被隐藏,完整显示。
// @description:zh-CN  该脚本修改Jable页面,使视频标题不再被隐藏,完整显示。
// @description:zh-TW  該指令碼修改Jable頁面,使視頻標題不再被隱藏,完整顯示。
// @description:en     This script modifies the Jable page to fully display video titles, no longer hiding them.
// @description:ko     이 스크립트는 Jable 페이지를 수정하여 비디오 제목이 숨겨지지 않고 완전히 표시되도록 합니다.
// @description:ja     このスクリプトは、Jableページを修正し、ビデオタイトルを隠さずに完全に表示します。
// @author       mrhydra
// @license      MIT
// @match        https://jable.tv/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=jable.tv
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function updateTitleStyles() {
        // 获取所有带有 .video-img-box .title 类的元素
        let titles = document.querySelectorAll('.video-img-box .title');

        titles.forEach(function(title) {
            title.style.whiteSpace = 'normal';
        });
    }

    // 使用 MutationObserver 监听 DOM 的变化
    const observer = new MutationObserver(updateTitleStyles);
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

    // 初始执行一次,以处理页面加载时的元素
    updateTitleStyles();
})();