-
-
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
Setting targetOriginDefault from frame content page. #199
Comments
Hi, Currently you can only set this on the sendMessage method. By default the parent checks messages come from the correct domain, but the iFrame doesn't have an option to restrict what page contains it currently. It's an option on sendMessage as you could be sending data that needs to be more secure than the size of the page. Allowing options to be set in the iFrame is on my todo list for version 3. D. |
Hi, Thanks for the quick response David. Page size could be also sensitive information if we are talking about financial data i.e. you could guess if a user has some type of investments or not. So, +1 to have possibility to set targetOrigin option from iframe content. Another improvement would be to set origin option (or list of origins) for isMessageFromIFrame function in iframeResizer.js. Currently, we could only use iframe.src as origin or switch checkOrigin to false. Do you plan to add something like this also? Andrej |
I'd be happy to take a patch that allowed an array of allowed origins to be passed to the checkOrigin property. So allowed values became |
Please check if following implementation is acceptable:
|
Hi, Looks good, but the http://youmightnotneedjquery.com/#index_of and then we would need to add a polyfil to the IE8 docs. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf Think it would be better to have one checkOriginFunction which can do both checks, rather than polymorphic construction which is going to be slow. Something like this maybe (Although I've not tested it).
Also it would be great if you could add a test for this. Dave. |
Hi David, I understand you concern regarding JQuery dependency. Here is updated patch. Regarding tests, it's hard to provide end-to-end test for such feature, because event.origin is null for file:// protocol and will be different for any other environment. We could somehow mock the data.origin but that will complicate the main code.
|
That's very hard to read in a ticket. Could you please make a pull request for it. |
Sure |
Feel free to use and add Selenium IDE tests to the project in order to On Thu, May 14, 2015 at 4:45 PM, Andrej Golcov [email protected]
~ Thank you, |
Option added to v3.0.0. |
Hi,
Is it possible to set targetOriginDefault parameter of iframeResizer.contentWindow script from iframe content page without enabling public methods?
Thanks,
Cheers, Andrej
The text was updated successfully, but these errors were encountered: