Skip to content

Instantly share code, notes, and snippets.

@findchris
Created December 7, 2011 02:29
Show Gist options
  • Select an option

  • Save findchris/1441158 to your computer and use it in GitHub Desktop.

Select an option

Save findchris/1441158 to your computer and use it in GitHub Desktop.
consumer page easyXDM Rpc
new easyXDM.Rpc(
{
swf: "http://ourstaticcontent/easyxdm.swf",
remote: content_url, // the URL of iframe opened by the consumer
container: container, // the iframe object
onReady: function() {
console.log('activityFrameLoaded: onReady'); // this gets called
}
},
{
remote: {},
local: {
test:function(){...}
}
});
@oyvindkinsey

oyvindkinsey commented Dec 7, 2011 via email

Copy link
Copy Markdown

@findchris

Copy link
Copy Markdown
Author

Ok, thanks. I set up the end point like so (in my content page):

easy_xdm_proxy = new easyXDM.Rpc(
{
  swf: document.location.protocol + "//static.site/js/easyxdm.swf",
  onReady: function() { console.log('provider onReady'); }
},
{
  remote: { start: {} },
  local: { }
});

And... the pages are communicating successfully. Despite this, I am seeing the following common XDM communication error:

Unsafe JavaScript attempt to access frame with URL http://testconsumer.com:3000/# from frame with URL http://provider/page?var=1&xdm_c=default1709&xdm_e=http%3A%2F%2Ftestconsumer.com%3A3000&xdm_p=1. Domains, protocols and ports must match.

Like I said, communication seems to work, so wondering why these errors are showing up. It looks like it occurs twice in the provider when the easyXDM RPC is created, and once in the consumer when the RPC is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment