From aa2816010dc724e3976dc3e639179221cdce7d66 Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 5 May 2016 16:04:43 -0700 Subject: inpage - automatic dapp reload --- app/scripts/lib/local-message-stream.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/scripts/lib/local-message-stream.js') diff --git a/app/scripts/lib/local-message-stream.js b/app/scripts/lib/local-message-stream.js index 42d193e04..76fedd9df 100644 --- a/app/scripts/lib/local-message-stream.js +++ b/app/scripts/lib/local-message-stream.js @@ -23,7 +23,7 @@ function LocalMessageDuplexStream(opts){ LocalMessageDuplexStream.prototype._onMessage = function(event){ var msg = event.data - // console.log('LocalMessageDuplexStream ('+this._name+') - heard message...') + // console.log('LocalMessageDuplexStream ('+this._name+') - heard message...', event) // validate message if (event.origin !== location.origin) return //console.log('LocalMessageDuplexStream ('+this._name+') - rejected - (event.origin !== location.origin) ') if (typeof msg !== 'object') return //console.log('LocalMessageDuplexStream ('+this._name+') - rejected - (typeof msg !== "object") ') @@ -31,7 +31,11 @@ LocalMessageDuplexStream.prototype._onMessage = function(event){ if (!msg.data) return //console.log('LocalMessageDuplexStream ('+this._name+') - rejected - (!msg.data) ') // console.log('LocalMessageDuplexStream ('+this._name+') - accepted', msg.data) // forward message - this.push(msg.data) + try { + this.push(msg.data) + } catch(err) { + this.emit('error', err) + } } // stream plumbing -- cgit v1.2.3