SeedHub - 显示扫码转存二维码

显示SeedHub网盘扫码转存二维码

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         SeedHub - 显示扫码转存二维码
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  显示SeedHub网盘扫码转存二维码
// @author      visionzk
// @license     MIT
// @match        https://www.seedhub.cc/link_start*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // 1. 强制显示 .mobile-pan 及其子元素
    GM_addStyle(`
        .mobile-pan,
        .mobile-pan * {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            height: auto !important;
            width: auto !important;
            max-height: none !important;
            max-width: none !important;
            position: static !important;
            clip: auto !important;
        }
    `);

    // 2. 隐藏 #qrcode 下的第一个 canvas
    GM_addStyle(`
        #qrcode canvas:first-of-type {
            display: none !important;
            visibility: hidden !important;
        }
    `);

    // 3. 动态检查(防止元素延迟加载)
    function applyStyles() {
        // 确保 .mobile-pan 显示
        const mobilePan = document.querySelector('.mobile-pan');
        if (mobilePan) {
            const setDisplayVisible = (element) => {
                element.style.display = 'block';
                element.style.visibility = 'visible';
                element.style.opacity = '1';
                Array.from(element.children).forEach(child => setDisplayVisible(child));
            };
            setDisplayVisible(mobilePan);
        }

        // 隐藏 #qrcode 下的第一个 canvas
        const qrcodeCanvas = document.querySelector('#qrcode canvas:first-of-type');
        if (qrcodeCanvas) {
            qrcodeCanvas.style.display = 'none';
            qrcodeCanvas.style.visibility = 'hidden';
        }
    }

    // 初始执行
    applyStyles();

    // 监听 DOM 变化(适用于动态加载内容)
    const observer = new MutationObserver(applyStyles);
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

    // 确保在页面完全加载后再次检查
    window.addEventListener('load', applyStyles);
})();