-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish/Subscribe across iframes #97
Comments
@Naethyn I'm interested in hearing what you're using for pub/sub across frames. Amplify's pub/sub doesn't current support that, unfortunately. I have a messaging lib (postal.js) that supports cross frame and web worker communications if you use the federation add-ons to enable it (postal.federation and postal.xframe). I've used xframe quite a bit, and @dcneiner has as well. Piping a local pub/sub lib to window.postMessage isn't terribly hard in and of itself - I've found the complexity comes into play with things like the timing of the handshake between the two windows, as well as properly filtering and identifying messages and their origin so that the same messages aren't replayed in a window, etc. If you glance at xframe's code, the stuff that actually touches |
I am making a Mobile Chrome App which uses iframes to encapsulate sandboxes (views). Currently, I am using pkg to communicate via iframes: http://burkeholland.github.io/pkg/ |
@Naethyn seems like you could potentially bridge pkg and amplify and just use pkg as the bridge/pseudo-transport between windows. Your components would publish and subscribe via amplify, and you could monkey patch amplify's subscribe and publish methods to set up subscriptions and publish messages to remote windows via pkg....that way your app only deals with amplify, and pkg is treated as pure infrastructure. I should insert a disclaimer, I work with Burke but haven't used pkg so it's possible this idea wouldn't work.... :-) |
I just also faced a need to send event to iFrame |
It would be very useful to be able to pub/sub across iframes. I currently use amplify for most of my project, but I have to use another solution for pub/sub across iframes. Thanks!
The text was updated successfully, but these errors were encountered: