muah.ai - Mod Panel

Replaces VIP-locked images with the actual image and provides a mod panel to open them in a new tab or download them.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         muah.ai - Mod Panel
// @license      MIT
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  Replaces VIP-locked images with the actual image and provides a mod panel to open them in a new tab or download them.
// @match        https://muah.ai/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function () {
    'use strict';

    const found = new Set();

    function unlock() {
        const locked = document.querySelectorAll('.media.is-locked');
        if (!locked.length) return;

        locked.forEach(el => {
            const img = el.querySelector('img');
            if (!img || !img.src) return;
            if (!found.has(img.src)) found.add(img.src);
            const newImg = document.createElement('img');
            newImg.src = img.src;
            newImg.alt = 'Chat media';
            el.replaceWith(newImg);
        });
    }

    const btn = document.createElement('button');
    btn.textContent = 'Mod Panel';
    Object.assign(btn.style, {
        position: 'fixed',
        top: '20px',
        right: '20px',
        zIndex: 99999,
        padding: '10px 18px',
        fontSize: '14px',
        fontWeight: 'bold',
        color: '#fff',
        backgroundColor: '#7c3aed',
        border: 'none',
        borderRadius: '8px',
        cursor: 'pointer'
    });

    let panel = null;

    function openPanel() {
        if (panel) { panel.remove(); panel = null; return; }

        panel = document.createElement('div');
        Object.assign(panel.style, {
            position: 'fixed',
            top: '70px',
            right: '20px',
            zIndex: 99999,
            width: '340px',
            maxHeight: '70vh',
            overflowY: 'auto',
            backgroundColor: '#fff',
            borderRadius: '10px',
            boxShadow: '0 4px 20px rgba(0,0,0,0.2)',
            padding: '16px'
        });

        let html = '<div style="font-size:14px;margin-bottom:12px;">Use <a href="https://temp-mail.org/" target="_blank" rel="noopener" style="color:#2563eb;font-weight:bold;text-decoration:none;">this</a> to have infinite accounts.</div>';

        if (!found.size) {
            html += '<div style="padding:8px;font-size:14px;">No images found.</div>';
        } else {
            let imgHtml = '<div style="font-weight:bold;margin-bottom:10px;">Images</div>';
            const srcs = Array.from(found);
            srcs.forEach((src, i) => {
                imgHtml += `<a href="${src}" target="_blank" rel="noopener" style="display:block;padding:8px;margin-bottom:6px;font-size:13px;color:#7c3aed;text-decoration:none;border:1px solid #e5e7eb;border-radius:6px;">Image ${i + 1} — Open in new tab</a>`;
                imgHtml += `<button data-src="${src}" style="display:block;width:100%;padding:8px;margin-bottom:6px;font-size:13px;color:#fff;background-color:#dc2626;border:none;border-radius:6px;cursor:pointer;">Download Image ${i + 1}</button>`;
            });
            html += imgHtml;
        }

        html += '<button id="refreshBtn" style="display:block;width:100%;padding:10px;margin-top:10px;font-size:14px;color:#fff;background-color:#2563eb;border:none;border-radius:6px;cursor:pointer;">Refresh Page</button>';

        panel.innerHTML = html;
        document.body.appendChild(panel);

        panel.querySelector('#refreshBtn').addEventListener('click', () => {
            location.reload();
        });
    }

    btn.addEventListener('click', openPanel);
    document.body.appendChild(btn);

    unlock();

    const observer = new MutationObserver(unlock);
    observer.observe(document.body, { childList: true, subtree: true });
})();