You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Chris Chabot <ch...@google.com> on 2009/06/18 07:49:29 UTC

javascript/container/osapi.js causing rpc errors

Hey All,

Per-instructions I've included javascript/container/osapi.js in my
container, however when I do I get an RPC error in Firefox (3.5RC1, mac):

*url is undefined:*
*** if (url.indexOf('//') == 0) {\n
*
in the getRelayUrl function. Without including osapi.js I do get a couple of
of osapi rpc errors, but RPC'ing in it's self (set title, resize, etc) works
just fine.

So either I'm missing something on the container side of things, or maybe
there's an issue with osapi.js? Any ideas where I should start to look
and/or what the issue could be?

   -- Chris

Re: javascript/container/osapi.js causing rpc errors

Posted by John Hjelmstad <fa...@google.com>.
Hi Chris:
I don't think this has to do with osapi.js -- instead, what's happening is
that the relayURL isn't set for the message receiver (presumably gadget ->
container).

FF3 uses window.postMessage, whose transport code does:
          var relay = gadgets.rpc.getRelayUrl(targetId);
          if (relay) {
            targetWin.postMessage(rpcData, relay);
          }

If no relayUrl is set for 'targetId' this error occurs. So, two things:

1. We shouldn't error this way. I've committed in r786228 a fix for this,
which was in rpc.js before but appears to have gotten rolled back in the
shuffle a week or so ago.
2. #1 will just avoid the confusing error. Without a relay set, wpm won't
work in this context. Who's calling whom in your setup?

--John

On Wed, Jun 17, 2009 at 10:49 PM, Chris Chabot <ch...@google.com> wrote:

> Hey All,
>
> Per-instructions I've included javascript/container/osapi.js in my
> container, however when I do I get an RPC error in Firefox (3.5RC1, mac):
>
> *url is undefined:*
> *** if (url.indexOf('//') == 0) {\n
> *
> in the getRelayUrl function. Without including osapi.js I do get a couple
> of of osapi rpc errors, but RPC'ing in it's self (set title, resize, etc)
> works just fine.
>
> So either I'm missing something on the container side of things, or maybe
> there's an issue with osapi.js? Any ideas where I should start to look
> and/or what the issue could be?
>
>    -- Chris
>