admin管理员组文章数量:1330565
I have an HTML and an iframe inside it. when I try to access iframe contents it shows error like this.
" Uncaught DOMException: Blocked a frame with origin "" from accessing a cross-origin frame.
at .html:14:24
(anonymous) @ test.html:14 "
how some chat panies like "inter" and etc, accessing iframe from external server and ponents inside iframe..?
I have an HTML and an iframe inside it. when I try to access iframe contents it shows error like this.
" Uncaught DOMException: Blocked a frame with origin "http://parattapayyan.surge.sh" from accessing a cross-origin frame.
at http://parattapayyan.surge.sh/test.html:14:24
(anonymous) @ test.html:14 "
how some chat panies like "inter" and etc, accessing iframe from external server and ponents inside iframe..?
Share Improve this question edited Dec 30, 2017 at 8:11 P.Thangamageswari 485 bronze badges asked Dec 30, 2017 at 7:12 Sanoj SenSanoj Sen 171 gold badge1 silver badge3 bronze badges 1- 2 Possible duplicate of SecurityError: Blocked a frame with origin from accessing a cross-origin frame – Deepak Keynes Commented Dec 30, 2017 at 7:25
1 Answer
Reset to default 1When Site A tries to fetch content from Site B in a frame, by default, Site B's pages are not accessible due to security reasons(Read this :: https://developer.mozilla/en-US/docs/Web/Security/Same-origin_policy); But using the Access-Control-Allow-Origin header site B can give cross-origin access to specific requesting origins.
Site B can serve its pages to Site A with the following response header:
Access-Control-Allow-Origin: http://www.siteA.
Without site B doing this, you won’t be able to access site A in a frame.
本文标签: javascriptAccessing Iframe Cross OriginStack Overflow
版权声明:本文标题:javascript - Accessing Iframe Cross Origin - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742224693a2435997.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论