-
-
Notifications
You must be signed in to change notification settings - Fork 983
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
Request: Support for complex messaging. #129
Comments
|
Then you can attach to it like this:
|
Hi, It's 2am here and I'm just back from a night out, so won't comment too much on your code just now. This was written to work along sided other messaging and both scripts, as you can see ignore anything not meant for them. The One of my design goal has been to ensure that their is version independence between the host page script and the iFrame script, you can use v2.6.5 with v1.0.0 and it will still work, all be it with much less feature support. I'm also inclined to think that writing a full blown router might be overkill for 99% of users of this. But as I said it's late here and I'm tired, so I should sleep on it. Dave. |
That said their could be a case for adding a As I said before need to sleep on it. |
That is really what I'm talking about just a more complex send object But get some sleep and give me an email when you have time! [image: 3sparks llc] [email protected] Seth Reid | Web Consultant/Developer 0221705966 | [email protected] On 6 December 2014 at 13:45, David J. Bradshaw [email protected]
|
Having thought about this a bit more I think the simplest solution is to have the The host page script and then detect the new message type, run Doing it this way requires the smallest amount of work, supports all the target browsers and is transparent to the end user. The only downside of using JSON, is that it allows for slightly less data types to be transfered, but these are real edge cases. https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/The_structured_clone_algorithm |
Thinking a bit more we can just run everything through |
Released as V2.7.0. |
Now some code like this should be included: (from jstorage:) So people include this to implement json support in older browsers. This is a breaking change in some older browsers... |
I did think about that, but the JSON object is supported in IE8 up, which is the base level for this lib. |
Yeah i just checked and noticed IE8 should support it natively. Don't know if it worked on IE7 before this fix. |
Nope, IE7 does not support postMessage. |
Ok, should not break anything then 👍 |
Hi,
I was thinking of forking this and creating the functionality for passing full JSON objects back and forth rather than just the simple string objects. Am I missing something and this is already possible?
I was thinking that I could create this with another config value of "allow-complex" or something and that way it wouldn't require another plugin to do this with and would mean if you want legacy support then you simply use the old method..
What do you think? I am going to using this plugin pretty heavily in a project for a client currently and have basically written what I'm talking about in a seperate plugin I wrote before I came across what you have done.
Would be keen to discuss with you some of hte approaches we have been using to handle communications between windows using dispatching custom events based on the message data that is being sent. So that other scripts can selectively attach to these events and not have to worry about the internals workings on what'g going on. This allows the windows to comunicate in a safe way that also allows one window to call into another windows functions while being walled off from free reign cross frame execution.
Will what I have working as a plugin on top of your work tha I was thinking could partially be intergrated into a more "advanced mode" or something.
The text was updated successfully, but these errors were encountered: