HamsterKombat PC bypass

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
        };


    }

})();