王者赛宝获取参数

获取王者赛宝自定义房间数据

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         王者赛宝获取参数
// @namespace    http://tampermonkey.net/
// @version      2023-12-23
// @description  获取王者赛宝自定义房间数据
// @author       You
// @match        https://h5.nes.smoba.qq.com/pvpesport.web.user/*
// @grant        none
// @license      MIT
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';

    (function (send) {

        XMLHttpRequest.prototype.send = function () {
            this.addEventListener('readystatechange', function () {
                if (this.readyState === 4) {
                    if (this.responseURL.includes("https://api.nes.smoba.qq.com/pvpesport.sgamenes.nesholder.nesholder/AddPubGameInfo")) {
                        console.log(this)
                        try {
                            var json = JSON.parse(this.responseText).game_info.match_rule_cfg.battle_custom_params
                            if (json.length > 0) {
                                var json_str = JSON.stringify(json)
                                prompt("已获取到数据 请复制下列输入框内容", json_str)
                            }
                        } catch {

                        }
                    }
                }
            }, false);

            send.apply(this, arguments);
        }

    })(XMLHttpRequest.prototype.send)

})();