Elethor WebSocket override for window hook

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

Pada tanggal 08 Januari 2021. Lihat %(latest_version_link).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Elethor 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.elethor.com/
// @version      0.0.3
// @author       Anders Morgan Larsen (Xortrox)
// @match        https://elethor.com/
// @match        https://www.elethor.com/
// @grant        none
// ==/UserScript==

const OldSocket = WebSocket;

window.WebSocket = function () {
    console.log('[WebSocket Hook] WebSocket hook successful.');
    const socket = new OldSocket(...arguments);
    window.socket = socket;

    return socket;
}