On Fri, Mar 14, 2008 at 6:55 PM, Martin Webb <[EMAIL PROTECTED]>
wrote:

> On Fri, Mar 14, 2008 at 6:42 PM, Kevin Brown <[EMAIL PROTECTED]> wrote:
>
> >
> > All cross domain calls are blocked (in all browsers I'm aware of)
> between
> > your local file system and a web server -- that means that rpc will only
> > work when both the page you're viewing and the server rendering the
> gadget
> > are served from web servers.
> >
>
> Okay - but...
>
> As long as you always access both the parent page and the iframe page from
> a
> > web server it'll work.
> >
>
> I've found that FF version 2.0.0.12 on Windows XP does not.  I tried
> tracking it down in Firebug to no avail.  I have successfully tested
> FF 3.0bon Windows XP and it works perfectly.


FF3 isn't using ifpc, it's using HTML5's postMessage.

If you're running the parent page and the iframe renderer on separate
domains, you have to make sure that the parent parameter passed to the
iframe matches and that the rpc_relay.html file is available from that root.


>
> Test case - run this on any other server other than localhost:8080
>
> <!DOCTYPE html>
> <html>
> <head>
> <title>Sample: Dynamic Height - fails on FF 2.0.0.12</title>
> <link rel="stylesheet" href="
> http://localhost:8080/gadgets/files/container/gadgets.css";>
> <script type="text/javascript" src="
> http://localhost:8080/gadgets/js/rpc.js?c=1&debug=1";></script>
> <script type="text/javascript" src="
> http://localhost:8080/gadgets/files/container/cookies.js";></script>
> <script type="text/javascript" src="
> http://localhost:8080/gadgets/files/container/gadgets.js";></script>
> <script type="text/javascript">
> var my = {};
>
> my.gadgetSpecUrls = [
>   'http://www.google.com/ig/modules/aue07otr.xml?debug=1'
> ];
>
> my.LayoutManager = function() {
>  gadgets.LayoutManager.call(this);
> };
>
> my.LayoutManager.inherits(gadgets.LayoutManager);
>
> my.LayoutManager.prototype.getGadgetChrome = function(gadget) {
>  var chromeId = 'gadget-chrome-' + gadget.id;
>  return chromeId ? document.getElementById(chromeId) : null;
> };
>
> my.init = function() {
>  gadgets.container.layoutManager = new my.LayoutManager();
>   
> gadgets.container.setParentUrl('http://localhost:8080'<http://localhost:8080%27>
> <http://localhost:8080%27>


Remove this line and you should be good. By default parentUrl is 'http://' +
document.location.host, which is exactly what you want.


> );
> };
>
> my.renderGadgets = function() {
>  for (var i = 0; i < my.gadgetSpecUrls.length; ++i) {
>    var gadget = gadgets.container.createGadget(
>        {specUrl: my.gadgetSpecUrls[i]});
>     
> gadget.setServerBase('http://localhost:8080/gadgets/'<http://localhost:8080/gadgets/%27>
> <http://localhost:8080/gadgets/%27>
>

This is what controls where iframes are rendered. To actually be secure this
value should always be a different host than the parent page. You don't want
third party content actually rendering on the same domain as the parent
page. "out of the box" we intentionally run everything on the same host to
make testing easier.


> );
>
>     gadgets.container.addGadget(gadget);
>    gadgets.container.renderGadget(gadget);
>  }
> };
> </script>
> </head>
> <body onLoad="my.init();my.renderGadgets()">
>  <h2>Sample: Dynamic Height</h2>
>  <div id="gadget-chrome-0" class="gadgets-gadget-chrome"></div>
> </body>
> </html>
>
> Regards
> Martin
> --
> Internet Related Technologies - http://www.irt.org
>



-- 
~Kevin

Reply via email to