IQRPG - WebSocket override for window hook

Overrides the WebSocket class and hooks any new instance of a WebSocket to a window.socket reference

目前為 2019-08-27 提交的版本,檢視 最新版本

// ==UserScript==
// @name         IQRPG - WebSocket override for window hook
// @description  Overrides the WebSocket class and hooks any new instance of a WebSocket to a window.socket reference
// @namespace    https://www.iqrpg.com/
// @version      0.0.1
// @author       Anders Morgan Larsen (Xortrox)
// @match        http://www.iqrpg.com/game.php
// @match        https://www.iqrpg.com/game.php
// @match        https://iqrpg.com/game.php
// @match        http://iqrpg.com/game.php
// @grant        none
// ==/UserScript==

const OldSocket = WebSocket;

function WebSocket() {
    const socket = new OldSocket(...arguments);
    window.socket = socket;

    return socket;
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址