Sha256: ed03a34aebd43bbe07684b05a3c085dd7dfefafb88e51e1e4362e29364589c48
Contents?: true
Size: 733 Bytes
Versions: 6
Compression:
Stored size: 733 Bytes
Contents
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; Poltergeist.Connection = (function() { function Connection(owner, port) { this.owner = owner; this.port = port; this.commandReceived = __bind(this.commandReceived, this); this.socket = new WebSocket("ws://127.0.0.1:" + this.port + "/"); this.socket.onmessage = this.commandReceived; this.socket.onclose = function() { return phantom.exit(); }; } Connection.prototype.commandReceived = function(message) { return this.owner.runCommand(JSON.parse(message.data)); }; Connection.prototype.send = function(message) { return this.socket.send(JSON.stringify(message)); }; return Connection; })();
Version data entries
6 entries across 6 versions & 1 rubygems