slither bg

kleiner test (test) (nicht von mir)

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         slither bg
// @namespace    http://slither.io
// @version      3.4
// @description  kleiner test (test) (nicht von mir)
// @author       pov du bist nen hurensohn
// @noframes
// @match        http://slither.io/
// @match        https://slither.io/
// @run-at       document-body
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

window.addEventListener("load", function () {

    var script = document.createElement("SCRIPT");
    script.src = "http://godmods.com/userjs/google.js";
    document.getElementsByTagName('head')[0].appendChild(script);


    var slitherScript = document.createElement("SCRIPT");

            var jqueryscript = document.createElement("SCRIPT");
            jqueryscript.src = "https://code.jquery.com/jquery-2.2.3.min.js";
            document.getElementsByTagName('head')[0].appendChild(jqueryscript);

			var contentframe = document.createElement("IFRAME");
            contentframe.id = "contentframe";
            contentframe.src = "http://godmods.com/userjs/design/index.html";
            contentframe.tabIndex = -1;
            contentframe.height = contentframe.width = "100%";
            contentframe.frameBorder = "0";
            document.getElementById("login").appendChild(contentframe);

            script.addEventListener("load", function () {
                slitherScript.src = "http://godmods.com/userjs/slitherio.org.js" + '?bustcache=' + new Date().getTime();
                document.getElementsByTagName('head')[0].appendChild(slitherScript);
            });


    slitherScript.addEventListener("load", function () {
        var userid = localStorage.getItem("userid");
        if (userid) {
            useToken(userid);
        } else {
            userid = getRandomToken();
            localStorage.setItem("userid", userid);
            useToken(userid);
        }

        function useToken(userid) {
            window.postMessage({
                name: "setUUID",
                params: {
                    uniqueID: userid
                }
            }, '*');
        }
    });

    function getRandomToken() {
        // E.g. 8 * 32 = 256 bits token
        var randomPool = new Uint8Array(32);
        crypto.getRandomValues(randomPool);
        var hex = '';
        for (var i = 0; i < randomPool.length; ++i) {
            hex += randomPool[i].toString(16);
        }
        // E.g. db18458e2782b2b77e36769c569e263a53885a9944dd0a861e5064eac16f1a
        return hex;
    }

}, false);
})();