HamsterKombat PC bypass

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
        };


    }

})();