HamsterKombat PC bypass

Plugin allows to join HamsterKombat via PC and prints it's authorization token

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         HamsterKombat PC bypass
// @name:ru      HamsterKombat PC обход
// @namespace    http://tampermonkey.net/
// @version      1.5
// @match        *://*/*
// @author       swat1x
// @description  Plugin allows to join HamsterKombat via PC and prints it's authorization token
// @description:ru Плагин позволяет зайти в HamsterKombat через ПК и вывести в консоль свой токен авторизации
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=hamsterkombat.io
// @grant        none
// ==/UserScript==


(function () {
    'use strict';

    if (location.hostname === 'hamsterkombatgame.io') {
        const original_indexOf = Array.prototype.indexOf
        Array.prototype.indexOf = function (...args) {
            if (JSON.stringify(this) === JSON.stringify(["android", "android_x", "ios"])) {
                setTimeout(() => {
                    Array.prototype.indexOf = original_indexOf
                })
                return 0;
            }
            return original_indexOf.apply(this, args)
        }


        var fetchedToken;
        const originalFetch = window.fetch;
        window.fetch = function (input, init) {
            if (init && init.method && init.method.toLowerCase() === 'post') {
                if (init.headers.Authorization && !fetchedToken && init.baseURL === 'https://api.hamsterkombatgame.io') {
                    fetchedToken = init.headers.Authorization
                    console.log("Copy it -> " + fetchedToken.split("Bearer ")[1])
                }
            }
            return originalFetch.apply(this, arguments);
        };


    }

})();