Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. WebSocket.prototype._send = WebSocket.prototype.send;
  2. WebSocket.prototype.send = function (data) {
  3. this._send(data);
  4. this.addEventListener('message', function (msg) {
  5. if (msg.data.indexOf('console')>0) {
  6. messages = (JSON.parse(JSON.parse(msg.data.substring(1))[0])[1]).messages.log;
  7. for (msg in messages) {
  8. console.log(messages[msg]);
  9. }
  10. };
  11. }, false);
  12. this.send = function (data) {
  13. this._send(data);
  14. };
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement