禁用相同的来源策略反应本机WebView

发布于 2025-01-30 05:09:02 字数 271 浏览 3 评论 0原文

我正在制作React Native应用程序,在内部,我正在使用React-Native-webview来渲染一些我需要访问元素的网页。在该网页中,我们有多个IFRAMES,但是由于Iframes没有相同的域,它给了我错误

通过访问用“ https:// xxxxxxxxxx xx”的框架,用原点“ https://xxxxxxx.xx”阻止了一个框架。协议,域和端口必须匹配。

我如何在反应 - 网络景观中禁用相同的蛋白酶?

谢谢

I am making a react native application and inside i am using react-native-webview to render some webpages where i need to gain access to elements. Inside that webpage we have multiple iframes but since iframes don't have the same domain it gives me error as

Blocked a frame with origin "https://XXXXXXXX.XX" from accessing a frame with origin "https://XXXXXXX.XX". Protocols, domains, and ports must match.

how can i disable same-origin-policy in react-native-webview?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

往昔成烟 2025-02-06 05:09:02

您不能禁用CORS保护,只需使用 rigins whitelist prop

You can't disable the CORS protection, just add your domain to it using originWhitelist prop

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文