Kahoot Namerator Bypass

Bypasses kahoot nickname generator

当前为 2023-03-09 提交的版本,查看 最新版本

// ==UserScript==
// @name        Kahoot Namerator Bypass
// @author      slither
// @version     2.0.0
// @license     MIT
// @description Bypasses kahoot nickname generator
// @match       https://kahoot.it/*
// @grant       none
// @run-at      document-start
// @namespace   https://gf.qytechs.cn/users/964173
// ==/UserScript==

const nativeSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function() {
    const oldCallback = this.onreadystatechange;

    this.onreadystatechange = function() {
        if (this.readyState === 4) {
            try {
                const response = JSON.parse(this.responseText);

                if (response.namerator === true) {
                    response.namerator = false;
                    alert("Namerator Bypassed!");
                }

                Object.defineProperty(this, "responseText",{
                    writable: false,
                    configurable: true,
                    value: JSON.stringify(response)
                });
            } catch (e) {
                console.error(e);
            }
        }

        if (oldCallback)
            return oldCallback.apply(this, arguments);
    };

    return nativeSend.apply(this, arguments);
};

const nativeWebSocket = window.WebSocket;
window.WebSocket = function() {
    const ws = new nativeWebSocket(...arguments);
    const nativeSend = ws.send;

    ws.send = function() {
        const interceptedMessage = JSON.parse(arguments[0]);

        if (interceptedMessage[0] && interceptedMessage[0].data && interceptedMessage[0].data.content === "{\"usingNamerator\":false}")
            interceptedMessage[0].data.content = "{\"usingNamerator\":true}";

        return nativeSend.apply(this, [JSON.stringify(interceptedMessage)]);
    };

    return ws;
};

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址