Greasy Fork is available in English.

HamsterKombat PC bypass

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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


    }

})();