Firefox google demo

You mean

if (window.freedom is undefined ) {
  // this means we are running in firefox extension
  window.freedom.on = self.port.on
}

???

I don't like it too much, but I'm guessing most of writing uproxy for
firefox will be figuring out how to refactor existing chrome code, so
better sooner than later.

Oh and yeah, i copied this code from ux.js


On Wed, Jun 18, 2014 at 1:30 PM, dborkan <notifications@github.com> wrote:

> In firefox-google-demo/lib/display.js:
>
> > +  log.appendChild(elt);
> > +  var br = document.createElement('br');
> > +  log.appendChild(br);
> > +  br.scrollIntoView();
> > +}
> > +var input = document.getElementById('msg-input');
> > +input.onkeydown = function(evt) {
> > +  if (evt.keyCode == 13) {
> > +    var text = input.value;
> > +    input.value = "";
> > +    appendLog(document.createTextNode("You: " + text + " To " + activeId));
> > +    self.port.emit('send-message', {to: activeId, message: text});
> > +  }
> > +};
> > +
> > +self.port.on("recv-buddylist", function(val){
>
> This looks almost identical to some of the code in demo_common/ux.js,
> except here uses self.port.on instead of window.freedom.on. Is there any
> way to refactor this so we share the same JS for display on both firefox
> and chrome? Would it make sense to set window.freedom.on=self.port.on in
> firefox?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/freedomjs/freedom-social-xmpp/pull/50/files#r13928234>
> .
>