oyvindkinsey / easyXDM

A javascript library providing cross-browser, cross-site messaging/method invocation.

Home Page:http://easyxdm.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with Safari on Mac

franckb opened this issue · comments

Hello,

I'm using easyXDM to resize iframe. Everything is working great on all major browsers except Safari 6 on Mac OS (it is working on Safari PC).

Here is what I get when running with the debug script:
127.0.0.1:8001 - 17:48:50.962: easyXDM present on 'http://127.0.0.1:8001/water/install/tkVP19rF430Csu6j9LzHl3ut0aPblsYs/
Debug.js:72127.0.0.1:8001 - 17:48:51.054: easyXDM.Socket: constructor
Debug.js:72127.0.0.1:8001 - 17:48:51.055: {Private}: preparing transport stack
Core.js:324Error: url is undefined or empty
Debug.js:117127.0.0.1:8001 - 17:48:51.056:{Private}: firing dom_onReady
Debug.js:117127.0.0.1:8001 - 17:48:51.056:... deferred messages ...
Debug.js:117127.0.0.1:8001 - 17:48:51.056:easyXDM.Socket: constructor
Debug.js:117127.0.0.1:8001 - 17:48:51.057:{Private}: preparing transport stack
Debug.js:117127.0.0.1:8001 - 17:48:51.057:... end of deferred messages ...

Here is what I have in the consumer:
new easyXDM.Socket({
remote: "{{ application.configuration_url }}?interactionKey={{ interaction.key }}",
container: document.getElementById("iframe-container"),
hash:true,
onMessage: function(message, origin){
message = JSON.parse(message);
var h = parseInt(message.height)+20;
this.container.getElementsByTagName("iframe")[0].style.height = message + "px";
}
});

And here is what I have in the provider:
var socket = new easyXDM.Socket({
onReady: function(){
socket.postMessage(JSON.stringify({height:document.body.scrollHeight}));
}
});

Any help would be greatly appreciated !

Thanks!

Don't know if this might help, but when printing the 'config' object to the console from function prepareTransportStack(config) (line 570 in easyXDM.js) I get this in Firefox (working):
channel "default1527"
isHost false
props Object {}
protocol "1"
remote "http://127.0.0.1:8000"
secret undefined
onReady function()

in Chrome (working):
channel: "default3008"
isHost: false
onReady: function (){
props: Object
protocol: "1"
remote: "http://127.0.0.1:8000"
secret: undefined
proto: Object

and in Safari on Mac (not working):
isHost: true
onReady: function () {
props: Object
proto: Object