Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s.text = `
- WebSocket.prototype = null; // extending WebSocket will throw an error if this is not set
- const ORIGINAL_WEBSOCKET = WebSocket;
- var WebSocket = window.WebSocket = class extends WebSocket {
- constructor(...args) {
- super(...args);
- this.addEventListener('message', event => {
- let ws_sniff_debug_from = new CustomEvent( "ws_sniff_debug_from", {
- detail: {
- data: event,
- obj: this
- }
- });
- document.body.dispatchEvent(ws_sniff_debug_from);
- });
- this.addEventListener('open', event => {
- let ws_sniff_debug_open = new CustomEvent( "ws_sniff_debug_open", {
- detail: {
- data: event,
- obj: this
- }
- });
- // document.body.dispatchEvent(ws_sniff_debug_open);
- });
- }
- send(...args) {
- let ws_sniff_debug_to = new CustomEvent( "ws_sniff_debug_to", {
- detail: {
- data: args[0],
- obj: this
- }
- });
- document.body.dispatchEvent(ws_sniff_debug_to);
- super.send(...args);
- }
- }
- `
Advertisement
Add Comment
Please, Sign In to add comment