CircleFTP Fix Tab Name And Movie Titles

Always show movie info and update page title to movie name on CircleFTP

当前为 2025-09-24 提交的版本,查看 最新版本

// ==UserScript==
// @name         CircleFTP Fix Tab Name And Movie Titles
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Always show movie info and update page title to movie name on CircleFTP
// @author       BlazeFTL
// @license      MIT
// @match        *://new.circleftp.net/*
// @grant        GM_addStyle
// ==/UserScript==

(function () {
    'use strict';

    // --- Style Fix: Always show movie info below posters ---
    const styleFix = `
    .SinglePost_singlePost_text__TQn9G {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: transparent !important;
        display: block !important;
        pointer-events: auto !important;
        margin-top: 10px !important;
    }

    .SinglePost_singlePost_card__MLfCk .overflow-hidden {
        flex-direction: column !important;
        align-items: center !important;
    }
    `;

    if (typeof GM_addStyle !== "undefined") {
        GM_addStyle(styleFix);
    } else {
        const style = document.createElement('style');
        style.textContent = styleFix;
        document.head.appendChild(style);
    }

    // --- Title Update: Set document title to movie name ---
    function updateTitle() {
        const h2 = document.querySelector('h2.text-white.text-bolder');
        if (h2 && h2.textContent.trim()) {
            document.title = h2.textContent.trim();
        }
    }

    window.addEventListener('load', updateTitle);

    const observer = new MutationObserver(() => {
        updateTitle();
    });

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