oracle-samples / xfc

A javascript library for Cross Frame Communication
Apache License 2.0
17 stars 24 forks source link

Consumer iframe not working on Firefox/Safari #16

Closed mbhargav294 closed 6 years ago

mbhargav294 commented 6 years ago

The following code works fine with chrome. But, Firefox/Safari does not load the iframe.

XFC.init();
XFC.Consumer.mount(document.getElementById('video_frame'), "url://xxx");

But, setting the iframe.src through the browser console after the page load, renders the iframe properly.

Possible fix: Setting iframe.src = this.source; after this.wrapper.appendChild(iframe); might fix the issue.

kafkahw commented 6 years ago

I think in your code snippet, you mistyped/misused init method. Instead of calling init directly on XFC (XFC.init()) , you might want to call XFC.Consumer.init().

As for the issue you reported, existing examples are using the same logic and they all work fine in Safari/Firefox. Here's an example: https://github.com/cerner/xfc/blob/a74c23f11d033d8cd099a73f588ce30fe6e2d068/example/cross_origin_communication/3_a_index.html#L84

Please try to reproduce the issue with our existing examples and provide more information. Otherwise, I'll close this issue as it's too vague.

kafkahw commented 6 years ago

closed since no response.