Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebSocket.prototype._send = WebSocket.prototype.send;
- WebSocket.prototype.send = function (data) {
- this._send(data);
- this.addEventListener('message', function (msg) {
- if (msg.data.indexOf('console')>0) {
- messages = (JSON.parse(JSON.parse(msg.data.substring(1))[0])[1]).messages.log;
- for (msg in messages) {
- console.log(messages[msg]);
- }
- };
- }, false);
- this.send = function (data) {
- this._send(data);
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement