splix-js-demodularizer

A vile trick that may aid you in executing your beloved scripts in the novel version of the client

Από την 15/05/2024. Δείτε την τελευταία έκδοση.

Αυτός ο κώδικας δεν πρέπει να εγκατασταθεί άμεσα. Είναι μια βιβλιοθήκη για άλλους κώδικες που περιλαμβάνεται μέσω της οδηγίας meta // @require https://update.greasyfork.org/scripts/478491/1377223/splix-js-demodularizer.js

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         splix-js-demodularizer
// @namespace    http://tampermonkey.net/
// @version      0.2.3
// @description  A vile trick that may aid you in executing your beloved scripts in the novel version of the client
// @author       You
// @match        https://splix.io/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=splix.io
// @grant        none
// @run-at       document-start
// ==/UserScript==

await (async function() {
    'use strict';

    function isAlreadyInjected() {
        for (let s of document.getElementsByTagName("script"))
            if (s.innerText.includes("globalThis.IS_DEV_BUILD"))
                return true;
        return false;
    }

    if (window.jsDemodularized || isAlreadyInjected() || document.location.pathname !== "/") return;

    const version = "0.2.3";
    const demodularizerVersion = localStorage.getItem("demodularizerVersion");
    const clientCode = localStorage.getItem("clientCode");

    if (demodularizerVersion === version) {
        document.open("text/html");
        document.write(clientCode);
        document.close();
        window.jsDemodularized = true;
    } else {
        window.stop();

        async function getContent(path) {
            let response = await fetch("https://raw.githubusercontent.com/jespertheend/splix/d41be0f6f4eba6be4e4cda2138452d5389311a07/client/" + path);
            return response.text();
        }

        const globals = (await getContent("src/globals.js")).replace("IS_DEV_BUILD = true", "IS_DEV_BUILD = false");
        const serverSelection = (await getContent("src/network/serverSelection.js")).replaceAll("export ", "");
        const main = "'use strict';\n" + globals + serverSelection + (await getContent("src/main.js")).replace(/.*/, "").substr(1).replace(/.*/, "").substr(1);
        const html = (await getContent("index.html")).substr(1).replace(/.*/, "").substr(1).replace(/<script.*?\/main.*?<\/script>/, "").replace("</body>", `<script>${main}</script></body>`)


        localStorage.setItem("clientCode", html);
        localStorage.setItem("demodularizerVersion", version);
        location.reload();
    }
})();