Moorer

Beam Pro WebSocket Capture for Chrome

Nov 19th, 2016
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         New Userscript
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://beam.pro/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     (function () {
  15.         WebSocket.prototype._send = WebSocket.prototype.send;
  16.         WebSocket.prototype.send = function (data) {
  17.             this._send(data);
  18.             this.addEventListener('message', function (msg) {
  19.                 console.log('>> ' + msg.data);
  20.             }, false);
  21.             this.send = function (data) {
  22.                 this._send(data);
  23.                 console.log("<< " + data);
  24.             };
  25.             console.log("<< " + data);
  26.         };
  27.     })();
  28.  
  29. })();
Add Comment
Please, Sign In to add comment