1

After reading this compendium of methods here Ways to circumvent the same-origin policy it's apparent that any workaround requires modification of the target iframe code to get communications across domains.

Unfortunately on this project I'm working on I may only modify the parent page's code, the iframe is provided from another source and is untouchable by us. Are there any methods that don't require modifications to the iframe code?

Community
  • 1
  • 1
龍王_
  • 73
  • 8

2 Answers2

1

The only solution then is to fetch the iframe content from your server, either through a proxy or through specific code, and serve it yourself so that the browser only sees one origin.

But be aware that this usually breaks the rules or contract of normal use of the site providing the iframe. If they didn't include CORS headers to allow inclusion and access, there's probably a reason.

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
0

No, there cant be such a method, that would kill the security.

Yaroslav Yakovlev
  • 6,303
  • 6
  • 39
  • 59