admin管理员组文章数量:1399963
I loaded a website of my own design in an iframe. This website contains links to other cross-domain pages. I wrote a javascript function to retrieve the title of the current page contained in the iframe, but when I run my application at localhost:3000, I get the error:
Uncaught DOMException: Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.
Even when I am using this javascript method on the page that was originally loaded in the iframe, I still get the same error. I would like to know exactly what is causing this error.
I loaded a website of my own design in an iframe. This website contains links to other cross-domain pages. I wrote a javascript function to retrieve the title of the current page contained in the iframe, but when I run my application at localhost:3000, I get the error:
Uncaught DOMException: Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.
Even when I am using this javascript method on the page that was originally loaded in the iframe, I still get the same error. I would like to know exactly what is causing this error.
Share Improve this question edited Aug 14, 2022 at 0:17 asked Aug 13, 2022 at 23:31 user19759133user197591331 Answer
Reset to default 3The Same Origin Policy is a security feature that protects user data across origins.
Consider what would happen if you loaded my webmail service into a frame on your site and were then able to access the DOM of that page. This would be a security disaster.
Even just reading the title could expose if I was logged in (and thus had an account on the site) or not (and probably don’t) which would be useful information for constructing a phishing attack.
本文标签:
版权声明:本文标题:javascript - What causes Uncaught DOMException: Blocked a frame with origin " " from accessing a cross-origin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744241315a2596802.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论