Link Copier

Allows you to copy links that you normally wouldn't be able to copy from (i.e. Maze, FFA, ect..)

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Link Copier
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Allows you to copy links that you normally wouldn't be able to copy from (i.e. Maze, FFA, ect..)
// @author       Someone
// @match        https://diep.io/
// ==/UserScript==

    var realSend = WebSocket.prototype.send;
    var mainWS;
    var serverWS;
    const URLRegex = /^wss?:\/\/[a-z0-9]{4}\.s\.m28n\.net\/$/g;
    let useServerFeatures = false;

    WebSocket.prototype.send = function(data)
    {
        if (!(data instanceof Int8Array && this.url.match(URLRegex)) || this.dontRegister)
        {
            return realSend.call(this, data);
        }

        if (this !== mainWS)
        {
            mainWS = this;
            this.serverID = this.url.split("://")[1].split(".")[0].toLowerCase();
            this.realRecv = this.onmessage;
            this.onmessage = function(event)
            {
                var data = new Uint8Array(event.data);
                switch (data[0])
                {
                    case 4:
                    {
                        if (!this.partyCode) this.onmessage({data: [6]});
                        break;
                    }
                                            case 6:
                    {
                        if (window.location.hash && window.location.hash.indexOf("00") && window.location.hash.indexOf("00") + 2 !== window.location.hash.length)
                        {
                            this.partyCode = window.location.hash.slice(window.location.hash.indexOf("00") + 2).toUpperCase();
                        }
                        else
                        {
                            this.partyCode = Array.from(data).slice(1).map(r => r.toString(16).padStart(2, "0").split('').reverse().join("")).join("").toUpperCase();
                            var x = this.partyCode;
                            console.log(x)
                        }
                        if (useServerFeatures) serverWS.send("\x00" + this.serverID + "\x00" + this.partyCode);
                        break;
                    }
                }
                return this.realRecv.call(this, event);
            }
        }
        return realSend.call(this, data);
    }