Chrome display this error in console "Unsafe JavaScript attempt to access frame with URL https://domain1/app1/ from frame with URL https://domain2/app1/. Domains, protocols and ports must match."
Asked
Active
Viewed 7,270 times
2 Answers
2
A frame cannot acces the content of another frame if it is not of the same origin. If that is what you're trying to achieve, you cannot work around that issue.

David Hedlund
- 128,221
- 31
- 203
- 222
-
I can confirm at least that I've found no way to do this. If you're trying to dynamically change the box size to fit the target of the frame, you can do this if you are able to put javascript on the CURRENTLY LOADED target of the frame (users can click on links inside the frame to bring them to other locations.) There's a stack overflow question which addresses this here: http://stackoverflow.com/questions/5589756/is-there-a-cross-domain-iframe-height-auto-resizer-that-works/6940711 – Sprague Nov 21 '12 at 11:31
2
The browser will not allow Javascript to access cross domain, as malicious websites would be able to interact with other sites which would be a huge security concern.
I found this on Google groups, might be worth looking at:
I believe that dev versions of Chrome currently have support for Cross-Origin Resource Sharing, which allows hosts that want to to opt-into cross-origin XHR access http://dev.w3.org/2006/waf/access-control. You could try that, but it's pretty bleeding edge, so I'd expect rough patches.

Tom Gullen
- 61,249
- 84
- 283
- 456